org.bouncycastle.openpgp
Class PGPKeyRingGenerator
java.lang.Object
org.bouncycastle.openpgp.PGPKeyRingGenerator
public class PGPKeyRingGenerator
extends java.lang.Object
Generator for a PGP master and subkey ring. This class will generate
both the secret and public key rings
PGPKeyRingGenerator
public PGPKeyRingGenerator(int certificationLevel,
PGPKeyPair masterKey,
String id,
int encAlgorithm,
char[] passPhrase,
PGPSignatureSubpacketVector hashedPcks,
PGPSignatureSubpacketVector unhashedPcks,
SecureRandom rand,
String provider)
throws PGPException,
NoSuchProviderException
Create a new key ring generator.
certificationLevel
- the certification level for keys on this ring.masterKey
- the master key pair.id
- the id to be associated with the ring.encAlgorithm
- the algorithm to be used to protect secret keys.passPhrase
- the passPhrase to be used to protect secret keys.hashedPcks
- packets to be include in the certification hash.unhashedPcks
- packets to be attached unhashed to the certification.rand
- input secured randomprovider
- the provider to use for encryption.
addSubKey
public void addSubKey(PGPKeyPair keyPair)
throws PGPException
Add a sub key to the key ring to be generated with default certification.
generatePublicKeyRing
public PGPPublicKeyRing generatePublicKeyRing()
Return the public key ring that corresponds to the secret key ring.
generateSecretKeyRing
public PGPSecretKeyRing generateSecretKeyRing()
Return the secret key ring.