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.
PGPException
-
generatePublicKeyRing
public PGPPublicKeyRing generatePublicKeyRing()
Return the public key ring that corresponds to the secret key ring.
- a public key ring.
generateSecretKeyRing
public PGPSecretKeyRing generateSecretKeyRing()
Return the secret key ring.
- a secret key ring.