From 51baa0e5cbad25cd6e952f35737e12657b13d487 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 17 May 2022 18:12:37 +0200 Subject: [PATCH] Add modernKeyRing(userId) shortcut method --- .../key/generation/KeyRingTemplates.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingTemplates.java b/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingTemplates.java index 0d663ff9..41d39a1a 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingTemplates.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/generation/KeyRingTemplates.java @@ -188,6 +188,21 @@ public final class KeyRingTemplates { return builder.build(); } + /** + * Generate a modern PGP key ring consisting of an ed25519 EdDSA primary key which is used to certify + * an X25519 XDH encryption subkey and an ed25519 EdDSA signing key. + * + * @param userId primary user id + * @return key ring + * + * @throws InvalidAlgorithmParameterException in case of invalid key generation parameters + * @throws NoSuchAlgorithmException in case of missing algorithm implementation in the crypto provider + * @throws PGPException in case of an OpenPGP related error + */ + public PGPSecretKeyRing modernKeyRing(String userId) throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException { + return modernKeyRing(userId, null); + } + /** * Generate a modern PGP key ring consisting of an ed25519 EdDSA primary key which is used to certify * an X25519 XDH encryption subkey and an ed25519 EdDSA signing key.