org.bouncycastle.openpgp
Class PGPSecretKeyRing
public class PGPSecretKeyRing
Holder for a collection of PGP secret keys.
PGPSecretKeyRing
public PGPSecretKeyRing(InputStream in)
throws IOException,
PGPException
PGPSecretKeyRing
public PGPSecretKeyRing(byte[] encoding)
throws IOException,
PGPException
encode
public void encode(OutputStream outStream)
throws IOException
getEncoded
public byte[] getEncoded()
throws IOException
getPublicKey
public PGPPublicKey getPublicKey()
Return the public key for the master key.
getSecretKey
public PGPSecretKey getSecretKey()
Return the master private key.
getSecretKeys
public Iterator getSecretKeys()
Return an iterator containing all the secret keys.
insertSecretKey
public static PGPSecretKeyRing insertSecretKey(PGPSecretKeyRing secRing,
PGPSecretKey secKey)
Returns a new key ring with the secret key passed in either added or
replacing an existing one with the same key ID.
secRing
- the secret key ring to be modified.secKey
- the secret key to be added.
removeSecretKey
public static PGPSecretKeyRing removeSecretKey(PGPSecretKeyRing secRing,
PGPSecretKey secKey)
Returns a new key ring with the secret key passed in removed from the
key ring.
secRing
- the secret key ring to be modified.secKey
- the secret key to be removed.
- a new secret key ring, or null if secKey is not found.