public class KeyRingBuilder extends Object implements KeyRingBuilderInterface
KeyRingBuilderInterface.Build, KeyRingBuilderInterface.WithPassphrase, KeyRingBuilderInterface.WithPrimaryUserId
Constructor and Description |
---|
KeyRingBuilder() |
Modifier and Type | Method and Description |
---|---|
PGPKeyRing |
simpleEcKeyRing(String userId)
Creates a key ring consisting of an ECDSA master key and an ECDH sub-key.
|
PGPKeyRing |
simpleRsaKeyRing(String userId,
RsaLength length)
Creates a simple RSA KeyPair of length
length with user-id userId . |
KeyRingBuilderInterface.WithPrimaryUserId |
withMasterKey(KeySpec spec) |
KeyRingBuilderInterface |
withSubKey(KeySpec type) |
public KeyRingBuilder()
public PGPKeyRing simpleRsaKeyRing(@Nonnull String userId, @Nonnull RsaLength length) throws org.bouncycastle.openpgp.PGPException, NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException
length
with user-id userId
.
The KeyPair consists of a single RSA master key which is used for signing, encryption and certification.userId
- user id.length
- length in bits.PGPSecretKeyRing
containing the KeyPair.org.bouncycastle.openpgp.PGPException
NoSuchAlgorithmException
NoSuchProviderException
InvalidAlgorithmParameterException
public PGPKeyRing simpleEcKeyRing(@Nonnull String userId) throws org.bouncycastle.openpgp.PGPException, NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException
userId
- user-idPGPSecretKeyRing
containing the key pairs.org.bouncycastle.openpgp.PGPException
NoSuchAlgorithmException
NoSuchProviderException
InvalidAlgorithmParameterException
public KeyRingBuilderInterface withSubKey(@Nonnull KeySpec type)
withSubKey
in interface KeyRingBuilderInterface
public KeyRingBuilderInterface.WithPrimaryUserId withMasterKey(@Nonnull KeySpec spec)
withMasterKey
in interface KeyRingBuilderInterface