Package org.pgpainless.key.generation
Class KeyRingBuilder
- java.lang.Object
-
- org.pgpainless.key.generation.KeyRingBuilder
-
- All Implemented Interfaces:
KeyRingBuilderInterface<KeyRingBuilder>
public class KeyRingBuilder extends Object implements KeyRingBuilderInterface<KeyRingBuilder>
-
-
Constructor Summary
Constructors Constructor Description KeyRingBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyRingBuilder
addSubkey(KeySpec keySpec)
KeyRingBuilder
addUserId(byte[] userId)
KeyRingBuilder
addUserId(String userId)
KeyRingBuilder
addUserId(String userId, SelfSignatureSubpackets.Callback subpacketsCallback)
org.bouncycastle.openpgp.PGPSecretKeyRing
build()
static org.bouncycastle.openpgp.PGPKeyPair
generateKeyPair(KeySpec spec)
KeyRingBuilder
setExpirationDate(Date expirationDate)
KeyRingBuilder
setPassphrase(Passphrase passphrase)
KeyRingBuilder
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 Detail
-
KeyRingBuilder
public KeyRingBuilder()
-
-
Method Detail
-
setPrimaryKey
public KeyRingBuilder setPrimaryKey(@Nonnull KeySpec keySpec)
- Specified by:
setPrimaryKey
in interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
addSubkey
public KeyRingBuilder addSubkey(@Nonnull KeySpec keySpec)
- Specified by:
addSubkey
in interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
addUserId
public KeyRingBuilder addUserId(@Nonnull String userId)
- Specified by:
addUserId
in interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
addUserId
public KeyRingBuilder addUserId(@Nonnull String userId, @Nullable SelfSignatureSubpackets.Callback subpacketsCallback)
-
addUserId
public KeyRingBuilder addUserId(@Nonnull byte[] userId)
- Specified by:
addUserId
in interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
setExpirationDate
public KeyRingBuilder setExpirationDate(@Nonnull Date expirationDate)
- Specified by:
setExpirationDate
in interfaceKeyRingBuilderInterface<KeyRingBuilder>
-
setPassphrase
public KeyRingBuilder setPassphrase(@Nonnull Passphrase passphrase)
- 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
-
-