Add documentation

This commit is contained in:
Paul Schaub 2018-06-28 15:08:30 +02:00
parent bcf76e6556
commit 8b24d1ac3e
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 13 additions and 0 deletions

View File

@ -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(