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 |
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 |
signOnlyKey()
Generate a sign-only OpenPGP key.
|
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, setSigningSubkeySubpackets
public OpenPGPKeyGenerator(OpenPGPImplementation implementation, boolean aead, java.util.Date creationTime) throws PGPException
PGPException
public OpenPGPKeyGenerator(OpenPGPImplementation implementationProvider, int version, boolean aead, java.util.Date creationTime) throws PGPException
PGPException
public 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 signOnlyKey() throws PGPException
PGPKeyPairGenerator.generatePrimaryKey()
for the key type.PGPException
- 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