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
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
PGPKeyRingGenerator
public PGPKeyRingGenerator(int certificationLevel,
PGPKeyPair masterKey,
java.lang.String id,
int encAlgorithm,
char[] passPhrase,
PGPSignatureSubpacketVector hashedPcks,
PGPSignatureSubpacketVector unhashedPcks,
java.security.SecureRandom rand,
java.lang.String provider)
throws PGPException,
java.security.NoSuchProviderException
- Create a new key ring generator.
- Parameters:
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.- Throws:
- PGPException -
- java.security.NoSuchProviderException -
addSubKey
public void addSubKey(PGPKeyPair keyPair)
throws PGPException
- Add a sub key to the key ring to be generated with default certification.
- Parameters:
keyPair
- - Throws:
- PGPException -
generateSecretKeyRing
public PGPSecretKeyRing generateSecretKeyRing()
- Return the secret key ring.
- Returns:
- a secret key ring.
generatePublicKeyRing
public PGPPublicKeyRing generatePublicKeyRing()
- Return the public key ring that corresponds to the secret key ring.
- Returns:
- a public key ring.