public class OpenPGPKeyGenerator extends AbstractOpenPGPKeySignatureGenerator
| Modifier and Type | Class and Description |
|---|---|
class |
OpenPGPKeyGenerator.WithPrimaryKey
Intermediate builder class.
|
defaultAeadAlgorithmPreferences, defaultCompressionAlgorithmPreferences, defaultFeatures, defaultHashAlgorithmPreferences, defaultSymmetricKeyPreferences, directKeySignatureSubpackets, encryptionSubkeySubpackets, signingSubkeySubpackets| Constructor and Description |
|---|
OpenPGPKeyGenerator(OpenPGPImplementation implementation,
boolean aead,
java.util.Date creationTime) |
OpenPGPKeyGenerator(OpenPGPImplementation implementationProvider,
int version,
boolean aead,
java.util.Date creationTime) |
OpenPGPKeyGenerator(OpenPGPImplementation implementationProvider,
int keyVersion,
PGPKeyPairGeneratorProvider kpGenProvider,
PGPDigestCalculatorProvider digestCalculatorProvider,
PBESecretKeyEncryptorFactory keyEncryptionBuilderProvider,
KeyFingerPrintCalculator keyFingerPrintCalculator,
java.util.Date creationTime)
Generate a new OpenPGP key generator for v6 keys.
|
| Modifier and Type | Method and Description |
|---|---|
OpenPGPKeyGenerator.WithPrimaryKey |
classicKey(java.lang.String userId)
Generate an OpenPGP key consisting of a certify-only primary key,
a dedicated signing-subkey and dedicated encryption-subkey.
|
OpenPGPKeyGenerator.WithPrimaryKey |
compositeRSAKey(int bitStrength,
java.lang.String userId)
Generate an OpenPGP key composed of 3 individual component keys based on RSA of the given strength in bits.
|
OpenPGPKeyGenerator.WithPrimaryKey |
ed25519x25519Key(java.lang.String userId)
Generate an OpenPGP key consisting of an Ed25519 certify-only primary key,
a dedicated Ed25519 sign-only subkey and dedicated X25519 encryption-only subkey.
|
OpenPGPKeyGenerator.WithPrimaryKey |
ed448x448Key(java.lang.String userId)
Generate an OpenPGP key consisting of an Ed448 certify-only primary key,
a dedicated Ed448 sign-only subkey and dedicated X448 encryption-only subkey.
|
OpenPGPKeyGenerator.WithPrimaryKey |
mlDsa65Ed25519MlKem768X25519Key(java.lang.String userId)
Generate a post-quantum/traditional OpenPGP key as RFC 9980 specifies it: an ML-DSA-65 + Ed25519
certify-only primary key, a dedicated ML-DSA-65 + Ed25519 sign-only subkey and a dedicated
ML-KEM-768 + X25519 encryption-only subkey - the two algorithms a conformant implementation MUST support.
|
OpenPGPKeyGenerator.WithPrimaryKey |
mlDsa87Ed448MlKem1024X448Key(java.lang.String userId)
Generate a post-quantum/traditional OpenPGP key at the higher RFC 9980 security level: an
ML-DSA-87 + Ed448 certify-only primary key, a dedicated ML-DSA-87 + Ed448 sign-only subkey and a
dedicated ML-KEM-1024 + X448 encryption-only subkey.
|
OpenPGPKeyGenerator.WithPrimaryKey |
signOnlyKey()
Generate a sign-only OpenPGP key.
|
OpenPGPKeyGenerator.WithPrimaryKey |
singletonRSAKey(int bitStrength,
java.lang.String userId)
Generate an OpenPGP key based on a single, multipurpose RSA key of the given strength.
|
OpenPGPKeyGenerator.WithPrimaryKey |
slhDsaShake128fMlKem768X25519Key(java.lang.String userId)
Generate a post-quantum OpenPGP key with fast hash-based signatures: an SLH-DSA-SHAKE-128f certify-only
primary key, a dedicated SLH-DSA-SHAKE-128f sign-only subkey and a dedicated ML-KEM-768 + X25519
encryption-only subkey (the combination of RFC 9980 Appendix A.6).
|
OpenPGPKeyGenerator.WithPrimaryKey |
slhDsaShake128sMlKem768X25519Key(java.lang.String userId)
Generate a post-quantum OpenPGP key with hash-based signatures: an SLH-DSA-SHAKE-128s certify-only
primary key, a dedicated SLH-DSA-SHAKE-128s sign-only subkey and a dedicated ML-KEM-768 + X25519
encryption-only subkey (the combination of RFC 9980 Appendix A.5).
|
OpenPGPKeyGenerator.WithPrimaryKey |
slhDsaShake256sMlKem1024X448Key(java.lang.String userId)
Generate a post-quantum OpenPGP key with hash-based signatures at the higher security level: an
SLH-DSA-SHAKE-256s certify-only primary key, a dedicated SLH-DSA-SHAKE-256s sign-only subkey and a
dedicated ML-KEM-1024 + X448 encryption-only subkey (the combination of RFC 9980 Appendix A.7).
|
OpenPGPKeyGenerator.WithPrimaryKey |
withPrimaryKey()
Generate an OpenPGP key with a certification-capable primary key.
|
OpenPGPKeyGenerator.WithPrimaryKey |
withPrimaryKey(KeyPairGeneratorCallback keyGenCallback)
Generate an OpenPGP key with a certification-capable primary key.
|
OpenPGPKeyGenerator.WithPrimaryKey |
withPrimaryKey(KeyPairGeneratorCallback keyGenCallback,
SignatureParameters.Callback preferenceSignatureCallback)
Generate an OpenPGP key with a certification-capable primary key.
|
setDefaultAeadAlgorithmPreferences, setDefaultCompressionAlgorithmPreferences, setDefaultFeatures, setDefaultHashAlgorithmPreferences, setDefaultSymmetricKeyPreferences, setDirectKeySignatureSubpackets, setEncryptionSubkeySubpackets, setSigningSubkeySubpacketspublic OpenPGPKeyGenerator(OpenPGPImplementation implementation, boolean aead, java.util.Date creationTime) throws PGPException
PGPExceptionpublic OpenPGPKeyGenerator(OpenPGPImplementation implementationProvider, int version, boolean aead, java.util.Date creationTime) throws PGPException
PGPExceptionpublic OpenPGPKeyGenerator(OpenPGPImplementation implementationProvider, int keyVersion, PGPKeyPairGeneratorProvider kpGenProvider, PGPDigestCalculatorProvider digestCalculatorProvider, PBESecretKeyEncryptorFactory keyEncryptionBuilderProvider, KeyFingerPrintCalculator keyFingerPrintCalculator, java.util.Date creationTime)
kpGenProvider - key pair generator providerdigestCalculatorProvider - digest calculator providerkeyEncryptionBuilderProvider - secret key encryption builder provider (AEAD)keyFingerPrintCalculator - calculator for key fingerprintscreationTime - key creation timepublic OpenPGPKeyGenerator.WithPrimaryKey classicKey(java.lang.String userId) throws PGPException
PGPKeyPairGenerator.generatePrimaryKey() for the primary key type,
PGPKeyPairGenerator.generateSigningSubkey() for the signing-subkey type and
PGPKeyPairGenerator.generateEncryptionSubkey() for the encryption-subkey key type.userId - nullable user idPGPException - if the key cannot be preparedpublic OpenPGPKeyGenerator.WithPrimaryKey ed25519x25519Key(java.lang.String userId) throws PGPException
userId - nullable user idPGPException - if the key cannot be generatedpublic OpenPGPKeyGenerator.WithPrimaryKey ed448x448Key(java.lang.String userId) throws PGPException
userId - nullable user idPGPException - if the key cannot be generatedpublic OpenPGPKeyGenerator.WithPrimaryKey mlDsa65Ed25519MlKem768X25519Key(java.lang.String userId) throws PGPException
userId - nullable user idPGPException - if the key cannot be generated, in particular for a key version other than 6public OpenPGPKeyGenerator.WithPrimaryKey mlDsa87Ed448MlKem1024X448Key(java.lang.String userId) throws PGPException
userId - nullable user idPGPException - if the key cannot be generated, in particular for a key version other than 6public OpenPGPKeyGenerator.WithPrimaryKey slhDsaShake128sMlKem768X25519Key(java.lang.String userId) throws PGPException
userId - nullable user idPGPException - if the key cannot be generated, in particular for a key version other than 6public OpenPGPKeyGenerator.WithPrimaryKey slhDsaShake128fMlKem768X25519Key(java.lang.String userId) throws PGPException
userId - nullable user idPGPException - if the key cannot be generated, in particular for a key version other than 6public OpenPGPKeyGenerator.WithPrimaryKey slhDsaShake256sMlKem1024X448Key(java.lang.String userId) throws PGPException
userId - nullable user idPGPException - if the key cannot be generated, in particular for a key version other than 6public OpenPGPKeyGenerator.WithPrimaryKey signOnlyKey() throws PGPException
PGPKeyPairGenerator.generatePrimaryKey() for the key type.PGPException - if the key cannot be generatedpublic OpenPGPKeyGenerator.WithPrimaryKey singletonRSAKey(int bitStrength, java.lang.String userId) throws PGPException
bitStrength - strength of the RSA key in bits (recommended values: 3072 and above).userId - optional user-idPGPException - if the key cannot be generated.public OpenPGPKeyGenerator.WithPrimaryKey compositeRSAKey(int bitStrength, java.lang.String userId) throws PGPException
bitStrength - strength of the keys in bits (recommended values: 3072 and above)userId - optional user-idPGPException - if the key cannot be generatedpublic OpenPGPKeyGenerator.WithPrimaryKey withPrimaryKey() throws PGPException
PGPKeyPairGenerator.generatePrimaryKey() for the primary key typePGPException - if the key cannot be generatedpublic OpenPGPKeyGenerator.WithPrimaryKey withPrimaryKey(KeyPairGeneratorCallback keyGenCallback) throws PGPException
KeyPairGeneratorCallback.keyGenCallback - callback to decide the key typePGPException - if the key cannot be generatedpublic OpenPGPKeyGenerator.WithPrimaryKey withPrimaryKey(KeyPairGeneratorCallback keyGenCallback, SignatureParameters.Callback preferenceSignatureCallback) throws PGPException
KeyPairGeneratorCallback.
The SignatureParameters.Callback can be used to modify the preferences in the direct-key self signature.
If the callback itself is null, the generator will create a default direct-key signature.
If the result of SignatureParameters.Callback.apply(SignatureParameters) is null, no direct-key
signature will be generated for the key.keyGenCallback - callback to decide the key typepreferenceSignatureCallback - callback to modify the direct-key signaturePGPException - if the key cannot be generated