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.PGPSecretKeyRingbuild()static org.bouncycastle.openpgp.PGPKeyPairgenerateKeyPair(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, waitMethods inherited from interface org.pgpainless.key.generation.KeyRingBuilderInterface
addSubkey, addUserId, setPrimaryKey
-
Constructor Details
-
KeyRingBuilder
public KeyRingBuilder()
-
-
Method Details
-
setPrimaryKey
- Specified by:
setPrimaryKeyin interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
addSubkey
- Specified by:
addSubkeyin interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
addUserId
- Specified by:
addUserIdin interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
addUserId
public KeyRingBuilder addUserId(@Nonnull String userId, @Nullable SelfSignatureSubpackets.Callback subpacketsCallback) -
addUserId
- Specified by:
addUserIdin interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
setExpirationDate
- Specified by:
setExpirationDatein interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
setPassphrase
- Specified by:
setPassphrasein interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
build
public org.bouncycastle.openpgp.PGPSecretKeyRing build() throws NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException, InvalidAlgorithmParameterException- Specified by:
buildin interfaceKeyRingBuilderInterface<KeyRingBuilder>- Throws:
NoSuchAlgorithmExceptionorg.bouncycastle.openpgp.PGPExceptionInvalidAlgorithmParameterException
-
generateKeyPair
public static org.bouncycastle.openpgp.PGPKeyPair generateKeyPair(KeySpec spec) throws NoSuchAlgorithmException, org.bouncycastle.openpgp.PGPException, InvalidAlgorithmParameterException - Throws:
NoSuchAlgorithmExceptionorg.bouncycastle.openpgp.PGPExceptionInvalidAlgorithmParameterException
-