Package org.pgpainless.key.generation
Class KeyRingTemplates
- java.lang.Object
-
- org.pgpainless.key.generation.KeyRingTemplates
-
public final class KeyRingTemplates extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description KeyRingTemplates()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.openpgp.PGPSecretKeyRing
modernKeyRing(java.lang.String userId)
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.PGPSecretKeyRing
modernKeyRing(java.lang.String userId, java.lang.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.PGPSecretKeyRing
modernKeyRing(java.lang.String userId, Passphrase passphrase)
org.bouncycastle.openpgp.PGPSecretKeyRing
simpleEcKeyRing(java.lang.String userId)
Creates a key ring consisting of an ed25519 EdDSA primary key and a curve25519 XDH subkey.org.bouncycastle.openpgp.PGPSecretKeyRing
simpleEcKeyRing(java.lang.String userId, java.lang.String password)
Creates a key ring consisting of an ed25519 EdDSA primary key and a X25519 XDH subkey.org.bouncycastle.openpgp.PGPSecretKeyRing
simpleEcKeyRing(java.lang.String userId, Passphrase passphrase)
org.bouncycastle.openpgp.PGPSecretKeyRing
simpleEcKeyRing(UserId userId)
Creates a key ring consisting of an ed25519 EdDSA primary key and a curve25519 XDH subkey.org.bouncycastle.openpgp.PGPSecretKeyRing
simpleEcKeyRing(UserId userId, java.lang.String password)
Creates a key ring consisting of an ed25519 EdDSA primary key and a curve25519 XDH subkey.org.bouncycastle.openpgp.PGPSecretKeyRing
simpleRsaKeyRing(java.lang.String userId, RsaLength length)
Creates a simple, unencrypted RSA KeyPair of lengthlength
with user-iduserId
.org.bouncycastle.openpgp.PGPSecretKeyRing
simpleRsaKeyRing(java.lang.String userId, RsaLength length, java.lang.String password)
Creates a simple RSA KeyPair of lengthlength
with user-iduserId
.org.bouncycastle.openpgp.PGPSecretKeyRing
simpleRsaKeyRing(java.lang.String userId, RsaLength length, Passphrase passphrase)
org.bouncycastle.openpgp.PGPSecretKeyRing
simpleRsaKeyRing(UserId userId, RsaLength length)
Creates a simple, unencrypted RSA KeyPair of lengthlength
with user-iduserId
.org.bouncycastle.openpgp.PGPSecretKeyRing
simpleRsaKeyRing(UserId userId, RsaLength length, java.lang.String password)
Creates a simple RSA KeyPair of lengthlength
with user-iduserId
.
-
-
-
Method Detail
-
simpleRsaKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleRsaKeyRing(@Nullable UserId userId, @Nonnull RsaLength length) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException
Creates a simple, unencrypted RSA KeyPair of lengthlength
with 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:
PGPSecretKeyRing
containing the KeyPair.- Throws:
java.security.InvalidAlgorithmParameterException
- in case of invalid key generation parametersjava.security.NoSuchAlgorithmException
- in case of missing algorithm implementation in the crypto providerorg.bouncycastle.openpgp.PGPException
- in case of an OpenPGP related error
-
simpleRsaKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleRsaKeyRing(@Nullable java.lang.String userId, @Nonnull RsaLength length) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException
Creates a simple, unencrypted RSA KeyPair of lengthlength
with 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:
PGPSecretKeyRing
containing the KeyPair.- Throws:
java.security.InvalidAlgorithmParameterException
- in case of invalid key generation parametersjava.security.NoSuchAlgorithmException
- in case of missing algorithm implementation in the crypto providerorg.bouncycastle.openpgp.PGPException
- in case of an OpenPGP related error
-
simpleRsaKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleRsaKeyRing(@Nullable UserId userId, @Nonnull RsaLength length, @Nullable java.lang.String password) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException
Creates a simple RSA KeyPair of lengthlength
with 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:
PGPSecretKeyRing
containing the KeyPair.- Throws:
java.security.InvalidAlgorithmParameterException
- in case of invalid key generation parametersjava.security.NoSuchAlgorithmException
- in case of missing algorithm implementation in the crypto providerorg.bouncycastle.openpgp.PGPException
- in case of an OpenPGP related error
-
simpleRsaKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleRsaKeyRing(@Nullable java.lang.String userId, @Nonnull RsaLength length, @Nullable java.lang.String password) throws org.bouncycastle.openpgp.PGPException, java.security.NoSuchAlgorithmException, java.security.InvalidAlgorithmParameterException
Creates a simple RSA KeyPair of lengthlength
with 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:
PGPSecretKeyRing
containing the KeyPair.- Throws:
java.security.InvalidAlgorithmParameterException
- in case of invalid key generation parametersjava.security.NoSuchAlgorithmException
- in case of missing algorithm implementation in the crypto providerorg.bouncycastle.openpgp.PGPException
- in case of an OpenPGP related error
-
simpleRsaKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleRsaKeyRing(@Nullable java.lang.String userId, @Nonnull RsaLength length, @Nonnull Passphrase passphrase) throws org.bouncycastle.openpgp.PGPException, java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException
- Throws:
org.bouncycastle.openpgp.PGPException
java.security.InvalidAlgorithmParameterException
java.security.NoSuchAlgorithmException
-
simpleEcKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleEcKeyRing(@Nullable UserId userId) throws java.security.InvalidAlgorithmParameterException, java.security.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:
PGPSecretKeyRing
containing the key pairs.- Throws:
java.security.InvalidAlgorithmParameterException
- in case of invalid key generation parametersjava.security.NoSuchAlgorithmException
- in case of missing algorithm implementation in the crypto providerorg.bouncycastle.openpgp.PGPException
- in case of an OpenPGP related error
-
simpleEcKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleEcKeyRing(@Nullable java.lang.String userId) throws java.security.InvalidAlgorithmParameterException, java.security.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:
PGPSecretKeyRing
containing the key pairs.- Throws:
java.security.InvalidAlgorithmParameterException
- in case of invalid key generation parametersjava.security.NoSuchAlgorithmException
- in case of missing algorithm implementation in the crypto providerorg.bouncycastle.openpgp.PGPException
- in case of an OpenPGP related error
-
simpleEcKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleEcKeyRing(@Nullable UserId userId, java.lang.String password) throws java.security.InvalidAlgorithmParameterException, java.security.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:
PGPSecretKeyRing
containing the key pairs.- Throws:
java.security.InvalidAlgorithmParameterException
- in case of invalid key generation parametersjava.security.NoSuchAlgorithmException
- in case of missing algorithm implementation in the crypto providerorg.bouncycastle.openpgp.PGPException
- in case of an OpenPGP related error
-
simpleEcKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleEcKeyRing(@Nullable java.lang.String userId, java.lang.String password) throws org.bouncycastle.openpgp.PGPException, java.security.NoSuchAlgorithmException, java.security.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:
PGPSecretKeyRing
containing the key pairs.- Throws:
java.security.InvalidAlgorithmParameterException
- in case of invalid key generation parametersjava.security.NoSuchAlgorithmException
- in case of missing algorithm implementation in the crypto providerorg.bouncycastle.openpgp.PGPException
- in case of an OpenPGP related error
-
simpleEcKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing simpleEcKeyRing(@Nullable java.lang.String userId, @Nonnull Passphrase passphrase) throws org.bouncycastle.openpgp.PGPException, java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException
- Throws:
org.bouncycastle.openpgp.PGPException
java.security.InvalidAlgorithmParameterException
java.security.NoSuchAlgorithmException
-
modernKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing modernKeyRing(@Nullable java.lang.String userId) throws org.bouncycastle.openpgp.PGPException, java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException
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 id- Returns:
- key ring
- Throws:
java.security.InvalidAlgorithmParameterException
- in case of invalid key generation parametersjava.security.NoSuchAlgorithmException
- in case of missing algorithm implementation in the crypto providerorg.bouncycastle.openpgp.PGPException
- in case of an OpenPGP related error
-
modernKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing modernKeyRing(@Nullable java.lang.String userId, @Nullable java.lang.String password) throws java.security.InvalidAlgorithmParameterException, java.security.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:
java.security.InvalidAlgorithmParameterException
- in case of invalid key generation parametersjava.security.NoSuchAlgorithmException
- in case of missing algorithm implementation in the crypto providerorg.bouncycastle.openpgp.PGPException
- in case of an OpenPGP related error
-
modernKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing modernKeyRing(@Nullable java.lang.String userId, @Nonnull Passphrase passphrase) throws org.bouncycastle.openpgp.PGPException, java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException
- Throws:
org.bouncycastle.openpgp.PGPException
java.security.InvalidAlgorithmParameterException
java.security.NoSuchAlgorithmException
-
-