Top Description Inners Fields Constructors Methods
org.bouncycastle.openpgp.api

public Class OpenPGPV6KeyGenerator

extends Object
Class Inheritance
Known Direct Subclasses
org.bouncycastle.openpgp.api.bc.BcOpenPGPV6KeyGenerator, org.bouncycastle.openpgp.api.jcajce.JcaOpenPGPV6KeyGenerator
Imports
java.io.IOException, java.util.ArrayList, .Date, .Iterator, .List, org.bouncycastle.bcpg.AEADAlgorithmTags, .CompressionAlgorithmTags, .HashAlgorithmTags, .PublicKeyPacket, .PublicKeyUtils, .PublicSubkeyPacket, .S2K, .SignatureSubpacketTags, .SymmetricKeyAlgorithmTags, org.bouncycastle.bcpg.sig.Features, .KeyFlags, .PreferredAEADCiphersuites, org.bouncycastle.openpgp.PGPException, .PGPKeyPair, .PGPPublicKey, .PGPSecretKey, .PGPSecretKeyRing, .PGPSignature, .PGPSignatureGenerator, .PGPSignatureSubpacketGenerator, org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator, .PBESecretKeyEncryptor, .PBESecretKeyEncryptorFactory, .PGPContentSignerBuilderProvider, .PGPDigestCalculatorProvider, .PGPKeyPairGenerator, .PGPKeyPairGeneratorProvider, org.bouncycastle.util.Arrays

High-level generator class for OpenPGP v6 keys.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
OpenPGPV6KeyGenerator.Configuration

Bundle configuration-specific data.

private static class
OpenPGPV6KeyGenerator.Implementation

Bundle implementation-specific provider classes.

private static class
public static class
OpenPGPV6KeyGenerator.WithPrimaryKey

Intermediate builder class.

Field Summary

Modifier and TypeField and Description
private final OpenPGPV6KeyGenerator.Configuration
public static SignatureSubpacketsFunction
DEFAULT_AEAD_ALGORITHM_PREFERENCES

Standard AEAD encryption preferences (SEIPDv2).

public static SignatureSubpacketsFunction
DEFAULT_COMPRESSION_ALGORITHM_PREFERENCES

Standard compression algorithm preferences.

public static SignatureSubpacketsFunction
DEFAULT_FEATURES

Standard features to announce.

public static SignatureSubpacketsFunction
DEFAULT_HASH_ALGORITHM_PREFERENCES

Standard signature hash algorithm preferences.

public static final int
DEFAULT_SIGNATURE_HASH_ALGORITHM

Hash algorithm for key signatures if no other one is provided during construction.

public static SignatureSubpacketsFunction
DEFAULT_SYMMETRIC_KEY_PREFERENCES

Standard symmetric-key encryption preferences (SEIPDv1).

public static SignatureSubpacketsFunction
DIRECT_KEY_SIGNATURE_SUBPACKETS

Standard signature subpackets for the direct-key signature.

public static SignatureSubpacketsFunction
ENCRYPTION_SUBKEY_SUBPACKETS

Standard signature subpackets for encryption subkey's binding signatures.

private final OpenPGPV6KeyGenerator.Implementation
private static final long
private static final long
private static final long
private static final long
public static SignatureSubpacketsFunction
SIGNING_SUBKEY_SUBPACKETS

Standard signature subpackets for signing subkey's binding signatures.

Constructor Summary

AccessConstructor and Description
public
OpenPGPV6KeyGenerator(PGPKeyPairGeneratorProvider
key pair generator provider
kpGenProvider
,
PGPContentSignerBuilderProvider
content signer builder provider
contentSignerBuilderProvider
,
PGPDigestCalculatorProvider
digest calculator provider
digestCalculatorProvider
,
PBESecretKeyEncryptorFactory
secret key encryption builder provider (AEAD)
keyEncryptionBuilderProvider
,
KeyFingerPrintCalculator
calculator for key fingerprints
keyFingerPrintCalculator
,
Date
key creation time
creationTime
)

Generate a new OpenPGP key generator for v6 keys.

Method Summary

Modifier and TypeMethod and Description
public PGPSecretKeyRing

Returns:

OpenPGP key
classicKey
(String
user id
userId
,
char[]
nullable passphrase.
passphrase
)

Generate an OpenPGP key consisting of a certify-only primary key, a dedicated signing-subkey and dedicated encryption-subkey.

public PGPSecretKeyRing

Returns:

OpenPGP key
ed25519x25519Key
(String
user id
userId
,
char[]
nullable passphrase
passphrase
)

Generate an OpenPGP key consisting of an Ed25519 certify-only primary key, a dedicated Ed25519 sign-only subkey and dedicated X25519 encryption-only subkey.

public PGPSecretKeyRing

Returns:

OpenPGP key
ed448x448Key
(String
user id
userId
,
char[]
nullable passphrase
passphrase
)

Generate an OpenPGP key consisting of an Ed448 certify-only primary key, a dedicated Ed448 sign-only subkey and dedicated X448 encryption-only subkey.

private OpenPGPV6KeyGenerator.WithPrimaryKey

Returns:

builder
primaryKeyWithDirectKeySig
(PGPKeyPair
primary key pair
primaryKeyPair
,
SignatureSubpacketsFunction
base signature subpackets callback
baseSubpackets
,
SignatureSubpacketsFunction
user-provided signature subpackets callback
customSubpackets
,
PBESecretKeyEncryptor
key encryptor
keyEncryptor
)

Specify the primary key and attach a direct-key signature.

public PGPSecretKeyRing

Returns:

sign-only (+certify) OpenPGP key
signOnlyKey
(char[]
nullable passphrase to protect the key with
passphrase
)

Generate a sign-only OpenPGP key.

public PGPSecretKeyRing

Returns:

sign-only (+certify) OpenPGP key
signOnlyKey
(char[]
nullable passphrase to protect the key with
passphrase
,
SignatureSubpacketsFunction
callback to modify the direct-key signature subpackets with
userSubpackets
)

Generate a sign-only OpenPGP key.

public PGPSecretKeyRing

Returns:

sign-only (+certify) OpenPGP key
signOnlyKey
(PGPKeyPair
signing-capable primary key
primaryKeyPair
,
PBESecretKeyEncryptor
nullable encryptor to protect the primary key with
keyEncryptor
,
SignatureSubpacketsFunction
callback to modify the direct-key signature subpackets with
userSubpackets
)

Generate a sign-only OpenPGP key.

public OpenPGPV6KeyGenerator.WithPrimaryKey

Returns:

builder
withPrimaryKey
()

Generate an OpenPGP key with a certification-capable primary key.

public OpenPGPV6KeyGenerator.WithPrimaryKey
public OpenPGPV6KeyGenerator.WithPrimaryKey

Returns:

builder
withPrimaryKey
(SignatureSubpacketsFunction
nullable callback to modify the direct-key signatures subpackets
directKeySubpackets
)

Generate an OpenPGP key with a certification-capable primary key.

public OpenPGPV6KeyGenerator.WithPrimaryKey

Returns:

builder
withPrimaryKey
(KeyPairGeneratorCallback
callback to specify the primary key type
keyGenCallback
,
SignatureSubpacketsFunction
nullable callback to modify the direct-key signatures subpackets
directKeySubpackets
)

Generate an OpenPGP key with a certification-capable primary key.

public OpenPGPV6KeyGenerator.WithPrimaryKey

Returns:

builder
withPrimaryKey
(PGPKeyPair
primary key
primaryKeyPair
,
SignatureSubpacketsFunction
nullable callback to modify the direct-key signatures subpackets
directKeySubpackets
)

Generate an OpenPGP key with a certification-capable primary key.

public OpenPGPV6KeyGenerator.WithPrimaryKey

Returns:

builder
withPrimaryKey
(KeyPairGeneratorCallback
callback to specify the primary key type
keyGenCallback
,
SignatureSubpacketsFunction
nullable callback to modify the direct-key signatures subpackets
directKeySubpackets
,
char[]
nullable passphrase to protect the primary key with
passphrase
)

Generate an OpenPGP key with a certification-capable primary key.

public OpenPGPV6KeyGenerator.WithPrimaryKey

Returns:

builder
withPrimaryKey
(final PGPKeyPair
primary key
primaryKeyPair
,
SignatureSubpacketsFunction
nullable callback to modify the direct-key signatures subpackets
directKeySubpackets
,
PBESecretKeyEncryptor
nullable encryptor to protect the primary key with
keyEncryptor
)

Generate an OpenPGP key with a certification-capable primary key.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait