From 8b24d1ac3e7bd10308c826713dab08181d7cc6d7 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 28 Jun 2018 15:08:30 +0200 Subject: [PATCH] Add documentation --- .../pgpainless/key/generation/KeyRingBuilder.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/de/vanitasvitae/crypto/pgpainless/key/generation/KeyRingBuilder.java b/src/main/java/de/vanitasvitae/crypto/pgpainless/key/generation/KeyRingBuilder.java index c46b14fa..13b80f53 100644 --- a/src/main/java/de/vanitasvitae/crypto/pgpainless/key/generation/KeyRingBuilder.java +++ b/src/main/java/de/vanitasvitae/crypto/pgpainless/key/generation/KeyRingBuilder.java @@ -62,6 +62,7 @@ public class KeyRingBuilder implements KeyRingBuilderInterface { /** * Creates a simple RSA KeyPair of length {@code length} with user-id {@code userId}. + * The KeyPair consists of a single RSA master key which is used for signing, encryption and certification. * * @param userId user id. * @param length length in bits. @@ -82,6 +83,18 @@ public class KeyRingBuilder implements KeyRingBuilderInterface { .build(); } + /** + * Creates a key ring consisting of an ECDSA master key and an ECDH sub-key. + * The ECDSA master key is used for signing messages and certifying the sub key. + * The ECDH sub-key is used for encryption of messages. + * + * @param userId user-id + * @return {@link PGPSecretKeyRing} containing the key pairs. + * @throws PGPException + * @throws NoSuchAlgorithmException + * @throws NoSuchProviderException + * @throws InvalidAlgorithmParameterException + */ public PGPSecretKeyRing simpleEcKeyRing(String userId) throws PGPException, NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException { return withSubKey(