Package org.pgpainless.key.generation
Class KeyRingTemplates
- java.lang.Object
-
- org.pgpainless.key.generation.KeyRingTemplates
-
public final class KeyRingTemplates extends Object
-
-
Constructor Summary
Constructors Constructor Description KeyRingTemplates()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.openpgp.PGPSecretKeyRingmodernKeyRing(String userId, String password)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.org.bouncycastle.openpgp.PGPSecretKeyRingsimpleEcKeyRing(String userId)Creates a key ring consisting of an ed25519 EdDSA primary key and a curve25519 XDH subkey.org.bouncycastle.openpgp.PGPSecretKeyRingsimpleEcKeyRing(String userId, String password)Creates a key ring consisting of an ed25519 EdDSA primary key and a X25519 XDH subkey.org.bouncycastle.openpgp.PGPSecretKeyRingsimpleEcKeyRing(UserId userId)Creates a key ring consisting of an ed25519 EdDSA primary key and a curve25519 XDH subkey.org.bouncycastle.openpgp.PGPSecretKeyRingsimpleEcKeyRing(UserId userId, String password)Creates a key ring consisting of an ed25519 EdDSA primary key and a curve25519 XDH subkey.org.bouncycastle.openpgp.PGPSecretKeyRingsimpleRsaKeyRing(String userId, RsaLength length)Creates a simple, unencrypted RSA KeyPair of lengthlengthwith user-iduserId.org.bouncycastle.openpgp.PGPSecretKeyRingsimpleRsaKeyRing(String userId, RsaLength length, String password)Creates a simple RSA KeyPair of lengthlengthwith user-iduserId.org.bouncycastle.openpgp.PGPSecretKeyRingsimpleRsaKeyRing(UserId userId, RsaLength length)Creates a simple, unencrypted RSA KeyPair of lengthlengthwith user-iduserId.org.bouncycastle.openpgp.PGPSecretKeyRingsimpleRsaKeyRing(UserId userId, RsaLength length, String password)Creates a simple RSA KeyPair of lengthlengthwith user-iduserId.
-
-
-
Constructor Detail
-
KeyRingTemplates
public KeyRingTemplates()
-
-
Method Detail
-
simpleRsaKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleRsaKeyRing(@Nonnull UserId userId, @Nonnull RsaLength length) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException
Creates a simple, unencrypted RSA KeyPair of lengthlengthwith user-iduserId. The KeyPair consists of a single RSA master key which is used for signing, encryption and certification.- Parameters:
userId- user id.length- length in bits.- Returns:
PGPSecretKeyRingcontaining the KeyPair.- Throws:
InvalidAlgorithmParameterExceptionNoSuchAlgorithmExceptionorg.bouncycastle.openpgp.PGPException
-
simpleRsaKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleRsaKeyRing(@Nonnull String userId, @Nonnull RsaLength length) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException
Creates a simple, unencrypted RSA KeyPair of lengthlengthwith user-iduserId. The KeyPair consists of a single RSA master key which is used for signing, encryption and certification.- Parameters:
userId- user id.length- length in bits.- Returns:
PGPSecretKeyRingcontaining the KeyPair.- Throws:
InvalidAlgorithmParameterExceptionNoSuchAlgorithmExceptionorg.bouncycastle.openpgp.PGPException
-
simpleRsaKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleRsaKeyRing(@Nonnull UserId userId, @Nonnull RsaLength length, String password) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException
Creates a simple RSA KeyPair of lengthlengthwith user-iduserId. The KeyPair consists of a single RSA master key which is used for signing, encryption and certification.- Parameters:
userId- user id.length- length in bits.password- Password of the key. Can be null for unencrypted keys.- Returns:
PGPSecretKeyRingcontaining the KeyPair.- Throws:
InvalidAlgorithmParameterExceptionNoSuchAlgorithmExceptionorg.bouncycastle.openpgp.PGPException
-
simpleRsaKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleRsaKeyRing(@Nonnull String userId, @Nonnull RsaLength length, String password) throws org.bouncycastle.openpgp.PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException
Creates a simple RSA KeyPair of lengthlengthwith user-iduserId. The KeyPair consists of a single RSA master key which is used for signing, encryption and certification.- Parameters:
userId- user id.length- length in bits.password- Password of the key. Can be null for unencrypted keys.- Returns:
PGPSecretKeyRingcontaining the KeyPair.- Throws:
org.bouncycastle.openpgp.PGPExceptionNoSuchAlgorithmExceptionInvalidAlgorithmParameterException
-
simpleEcKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleEcKeyRing(@Nonnull UserId userId) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException
Creates a key ring consisting of an ed25519 EdDSA primary key and a curve25519 XDH subkey. The EdDSA primary key is used for signing messages and certifying the sub key. The XDH subkey is used for encryption and decryption of messages.- Parameters:
userId- user-id- Returns:
PGPSecretKeyRingcontaining the key pairs.- Throws:
InvalidAlgorithmParameterExceptionNoSuchAlgorithmExceptionorg.bouncycastle.openpgp.PGPException
-
simpleEcKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleEcKeyRing(@Nonnull String userId) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException
Creates a key ring consisting of an ed25519 EdDSA primary key and a curve25519 XDH subkey. The EdDSA primary key is used for signing messages and certifying the sub key. The XDH subkey is used for encryption and decryption of messages.- Parameters:
userId- user-id- Returns:
PGPSecretKeyRingcontaining the key pairs.- Throws:
InvalidAlgorithmParameterExceptionNoSuchAlgorithmExceptionorg.bouncycastle.openpgp.PGPException
-
simpleEcKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleEcKeyRing(@Nonnull UserId userId, String password) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException
Creates a key ring consisting of an ed25519 EdDSA primary key and a curve25519 XDH subkey. The EdDSA primary key is used for signing messages and certifying the sub key. The XDH subkey is used for encryption and decryption of messages.- Parameters:
userId- user-idpassword- Password of the private key. Can be null for an unencrypted key.- Returns:
PGPSecretKeyRingcontaining the key pairs.- Throws:
InvalidAlgorithmParameterExceptionNoSuchAlgorithmExceptionorg.bouncycastle.openpgp.PGPException
-
simpleEcKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleEcKeyRing(@Nonnull String userId, String password) throws org.bouncycastle.openpgp.PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException
Creates a key ring consisting of an ed25519 EdDSA primary key and a X25519 XDH subkey. The EdDSA primary key is used for signing messages and certifying the sub key. The XDH subkey is used for encryption and decryption of messages.- Parameters:
userId- user-idpassword- Password of the private key. Can be null for an unencrypted key.- Returns:
PGPSecretKeyRingcontaining the key pairs.- Throws:
org.bouncycastle.openpgp.PGPExceptionNoSuchAlgorithmExceptionInvalidAlgorithmParameterException
-
modernKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing modernKeyRing(String userId, String password) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException
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.- Parameters:
userId- primary user idpassword- passphrase or null if the key should be unprotected.- Returns:
- key ring
- Throws:
InvalidAlgorithmParameterExceptionNoSuchAlgorithmExceptionorg.bouncycastle.openpgp.PGPException
-
-