Package org.pgpainless.key.generation
Class KeyRingBuilder
java.lang.Object
org.pgpainless.key.generation.KeyRingBuilder
- All Implemented Interfaces:
KeyRingBuilderInterface<KeyRingBuilder>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddUserId
(byte[] userId) addUserId
(String userId, SelfSignatureSubpackets.Callback subpacketsCallback) org.bouncycastle.openpgp.PGPSecretKeyRing
build()
static org.bouncycastle.openpgp.PGPKeyPair
generateKeyPair
(KeySpec spec) setExpirationDate
(Date expirationDate) setPassphrase
(Passphrase passphrase) setPrimaryKey
(KeySpec keySpec) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.pgpainless.key.generation.KeyRingBuilderInterface
addSubkey, addUserId, setPrimaryKey
-
Constructor Details
-
KeyRingBuilder
public KeyRingBuilder()
-
-
Method Details
-
setPrimaryKey
- Specified by:
setPrimaryKey
in interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
addSubkey
- Specified by:
addSubkey
in interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
addUserId
- Specified by:
addUserId
in interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
addUserId
public KeyRingBuilder addUserId(@Nonnull String userId, @Nullable SelfSignatureSubpackets.Callback subpacketsCallback) -
addUserId
- Specified by:
addUserId
in interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
setExpirationDate
- Specified by:
setExpirationDate
in interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
setPassphrase
- Specified by:
setPassphrase
in interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
build
public org.bouncycastle.openpgp.PGPSecretKeyRing build() throws NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException, InvalidAlgorithmParameterException- Specified by:
build
in interfaceKeyRingBuilderInterface<KeyRingBuilder>
- Throws:
NoSuchAlgorithmException
org.bouncycastle.openpgp.PGPException
InvalidAlgorithmParameterException
-
generateKeyPair
public static org.bouncycastle.openpgp.PGPKeyPair generateKeyPair(KeySpec spec) throws NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException, InvalidAlgorithmParameterException - Throws:
NoSuchAlgorithmException
org.bouncycastle.openpgp.PGPException
InvalidAlgorithmParameterException
-