Commit Graph

3 Commits

Author SHA1 Message Date
Paul Schaub a65ea26181
Add tests for PublicKeyAlgorithmPolicy 2021-06-11 16:47:22 +02:00
Paul Schaub 5bb4fd3687
Add PublicKeyAlgorithmPolicy to reject weak public keys
BCs PGPPublicKey.getBitStrenght() appears to fail to recognize some elliptic curves.
In such cases, bitStrength is reported as -1.
I added BCUtil.getBitStrength(publicKey) to manually determine the bit strenght by OID.
See https://github.com/bcgit/bc-java/issues/972 for an upstream bug report.
2021-06-11 16:20:29 +02:00
Paul Schaub ed8584df95
Add policy tests 2021-06-10 15:41:44 +02:00