org.bouncycastle.openpgp
Class PGPPublicKeyRing
java.lang.Object
org.bouncycastle.openpgp.PGPPublicKeyRing
public class PGPPublicKeyRing
extends java.lang.Object
general class to hold a collection of PGP Public Keys.
PGPPublicKeyRing
public PGPPublicKeyRing(InputStream in)
throws IOException
PGPPublicKeyRing
public PGPPublicKeyRing(byte[] encoding)
throws IOException
encode
public void encode(OutputStream outStream)
throws IOException
getEncoded
public byte[] getEncoded()
throws IOException
getPublicKey
public PGPPublicKey getPublicKey()
Return the first public key in the ring.
getPublicKey
public PGPPublicKey getPublicKey(long keyID)
throws PGPException
Return the public key refered to by the passed in keyID if it
is present.
getPublicKeys
public Iterator getPublicKeys()
Return an iterator containing all the public keys.
insertPublicKey
public static PGPPublicKeyRing insertPublicKey(PGPPublicKeyRing pubRing,
PGPPublicKey pubKey)
Returns a new key ring with the public key passed in
either added or replacing an existing one.
pubRing
- the public key ring to be modifiedpubKey
- the public key to be added.
removePublicKey
public static PGPPublicKeyRing removePublicKey(PGPPublicKeyRing pubRing,
PGPPublicKey pubKey)
Returns a new key ring with the public key passed in
removed from the key ring.
pubRing
- the public key ring to be modifiedpubKey
- the public key to be added.
- a new keyRing, null if pubKey is not found.