Paul Schaub
be47a96030
Further simplify the KeyRingBuilder API
2021-09-20 12:30:03 +02:00
Paul Schaub
21f424551b
Simplify KeySpecBuilder
2021-09-13 19:46:18 +02:00
Paul Schaub
48314fde40
Assign sensible names to test() methods
2021-07-03 13:23:11 +02:00
Paul Schaub
43a21de53a
Delete useless GenerateKeyTest
2021-07-03 12:59:33 +02:00
Paul Schaub
84ff6ce015
Improve tests
2021-07-03 12:42:17 +02:00
Paul Schaub
63c75f1f86
Rename TestUtil -> TestImplementationFactoryProvider
2021-07-03 12:42:12 +02:00
Paul Schaub
dff47d17d1
Remove more unused methods and fix method name
2021-06-28 21:14:40 +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
8618d1faea
More tests
2021-05-31 13:59:56 +02:00
Paul Schaub
b07cb2467b
Alter tests to cover untested KeyRingBuilderInterface methods
2021-05-30 18:05:38 +02:00
Paul Schaub
64cc9ecca4
Proper Signature Verification
2021-04-30 09:49:19 +02:00
Paul Schaub
883c819536
GenerateKeyTest: Print public key instead of secret key
2021-03-18 21:33:39 +01:00
Paul Schaub
bfab4b60f0
Introduce parametrized tests to also test the JceImplementationFactory
2021-02-25 23:27:08 +01:00
Paul Schaub
3e75d325a8
Stabilize test
...
The test was sometimes failing, as generating RSA keys can take longer than 1 second, which would result in the delta in the check being exceeded
2021-02-20 01:08:51 +01:00
Paul Schaub
c75a192513
Use ArmoredOutputStreamFactory to hide version string in ascii armor
...
Partially fixes #82
2021-02-19 19:50:36 +01:00
Paul Schaub
f2f7305fec
Allow for setting of expiration date during key generation
2021-02-13 12:22:28 +01:00
Paul Schaub
651bb63175
Deprecate withMasterKey(spec) in favor of withPrimaryKey(spec)
2021-02-11 17:18:59 +01:00
Paul Schaub
79b2d42f9c
Add support for more elliptic curves and start implementing KeyInfo class
2021-02-11 16:58:00 +01:00
Paul Schaub
5143da1311
Verify that keys can carry certain key flags
2021-01-03 17:01:08 +01:00
Paul Schaub
2378162953
Remove withDefaultKeyFlags method
2021-01-03 16:26:53 +01:00
Paul Schaub
ca6089eeac
Add test to verify that primary key can certify§
2020-12-11 22:54:27 +01:00
Paul Schaub
3c88bdde9b
Refactor keytype related classes
2020-12-08 20:02:41 +01:00
Paul Schaub
4550425609
Wip: Add more elliptic curves, support for {X,Ed}25519
2020-12-08 19:26:57 +01:00
Paul Schaub
980782e629
Remove deprecated class PGPKeyRing
2020-12-08 19:14:52 +01:00
Paul Schaub
aafc9be888
Switch to Jupiter JUnit for tests
2020-11-13 16:31:59 +01:00
Paul Schaub
99a2fcf1c0
Simplify KeyType API
2020-11-07 18:24:12 +01:00
Paul Schaub
d0580918fa
Fix checkstyle issues
2020-10-30 12:38:59 +01:00
Wiktor Kwapisiewicz
59fe53c594
Fix creating keys with Passphrase.emptyPassphrase()
...
Previously the code supplied `null` to BouncyCastle's
encryptor/decryptor builder's build method and that caused
NullPointerException to be thrown.
The fix checks if the passphrase is empty and omits the BouncyCastle
builder in that case.
Fixes #16 .
2020-10-30 12:22:05 +01:00
Wiktor Kwapisiewicz
e30d0f6293
Remove RSA_SIGN and RSA_ENCRYPT as they are deprecated
...
This change removes two mechanisms that are deprecated in RFC 4880. The
spec explicitly mentions that "RSA Encrypt-Only (2) and RSA Sign-Only
are deprecated and SHOULD NOT be generated" [0].
The remaining RSA_GENERAL key type was renamed to just RSA for ease of
use for developers.
[0]: https://tools.ietf.org/html/rfc4880#section-9.1
2020-10-30 11:48:28 +01:00
Paul Schaub
f21231ad53
Trim user-ids
2020-10-20 23:23:25 +02:00
Paul Schaub
1b389f678a
Fix checkstyle issues
2020-10-20 22:58:45 +02:00
Paul Schaub
9670e5ecb9
Prevent additional user-id from being equal to primary user-id
2020-10-20 22:14:56 +02:00
Paul Schaub
2f85c9a8d0
Test if userId is present
2020-10-16 13:18:07 +02:00
Paul Schaub
8c30db9bf1
Wip: Allow for additional user-ids to be added
2020-10-16 12:46:58 +02:00
Paul Schaub
ba6e850f6f
Improve logging of tests
2020-04-11 11:35:48 +02:00
Paul Schaub
745e296799
Move GenerateKeyTest to generate package
2020-01-12 23:34:12 +01:00