Top Description Fields Constructors Methods
org.bouncycastle.openpgp

public abstract Class PGPKeyRing

extends Object
Class Inheritance
Known Direct Subclasses
org.bouncycastle.openpgp.PGPPublicKeyRing, org.bouncycastle.openpgp.PGPSecretKeyRing
Imports
java.io.IOException, .OutputStream, java.util.ArrayList, .Iterator, .List, java.util.logging.Level, .Logger, org.bouncycastle.bcpg.BCPGInputStream, .KeyIdentifier, .Packet, .PacketFormat, .PacketTags, .SignaturePacket, .TrustPacket, .UnsupportedPacketVersionException, .UserAttributePacket, .UserDataPacket, .UserIDPacket

Parent class for PGP public and secret key rings.

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public abstract void
encode(OutputStream outStream)

public abstract byte[]
public abstract byte[]
public abstract Iterator<PGPPublicKey>

Returns:

an iterator (possibly empty) of the public keys associated with keyID.
getKeysWithSignaturesBy
(long keyID)

Return an iterator containing all the public keys carrying signatures issued from key keyID.

public abstract Iterator<PGPPublicKey>
public abstract PGPPublicKey

Returns:

PGPPublicKey
getPublicKey
()

Return the first public key in the ring.

public abstract PGPPublicKey

Returns:

PGPPublicKey with matching keyID.
getPublicKey
(long
the full keyID of the key of interest.
keyID
)

Return the public key referred to by the passed in keyID if it is present.

public abstract PGPPublicKey

Returns:

PGPPublicKey with the matching fingerprint.
getPublicKey
(byte[]
the full fingerprint of the key of interest.
fingerprint
)

Return the public key with the passed in fingerprint if it is present.

public abstract PGPPublicKey
public abstract Iterator<PGPPublicKey>

Returns:

Iterator
getPublicKeys
()

Return an iterator containing all the public keys.

public abstract Iterator<PGPPublicKey>
private static boolean
isUserTag(int tag)

pack-priv static TrustPacket
pack-priv static List<PGPSignature>
pack-priv static void
public abstract int

Returns:

number of keys (master key + subkey).
size
()

Return the number of keys in the key ring.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Logger LOG

Constructor Detail

PGPKeyRingback to summary
pack-priv PGPKeyRing()

Method Detail

encodeback to summary
public abstract void encode(OutputStream outStream) throws IOException
getEncodedback to summary
public abstract byte[] getEncoded() throws IOException
getEncodedback to summary
public abstract byte[] getEncoded(PacketFormat format) throws IOException
getKeysWithSignaturesByback to summary
public abstract Iterator<PGPPublicKey> getKeysWithSignaturesBy(long keyID)

Return an iterator containing all the public keys carrying signatures issued from key keyID.

Returns:Iterator<PGPPublicKey>

an iterator (possibly empty) of the public keys associated with keyID.

getKeysWithSignaturesByback to summary
public abstract Iterator<PGPPublicKey> getKeysWithSignaturesBy(KeyIdentifier identifier)
getPublicKeyback to summary
public abstract PGPPublicKey getPublicKey()

Return the first public key in the ring. In the case of a PGPSecretKeyRing this is also the public key of the master key pair.

Returns:PGPPublicKey

PGPPublicKey

getPublicKeyback to summary
public abstract PGPPublicKey getPublicKey(long keyID)

Return the public key referred to by the passed in keyID if it is present.

Parameters
keyID:long

the full keyID of the key of interest.

Returns:PGPPublicKey

PGPPublicKey with matching keyID.

getPublicKeyback to summary
public abstract PGPPublicKey getPublicKey(byte[] fingerprint)

Return the public key with the passed in fingerprint if it is present.

Parameters
fingerprint:byte[]

the full fingerprint of the key of interest.

Returns:PGPPublicKey

PGPPublicKey with the matching fingerprint.

getPublicKeyback to summary
public abstract PGPPublicKey getPublicKey(KeyIdentifier identifier)
getPublicKeysback to summary
public abstract Iterator<PGPPublicKey> getPublicKeys()

Return an iterator containing all the public keys.

Returns:Iterator<PGPPublicKey>

Iterator

getPublicKeysback to summary
public abstract Iterator<PGPPublicKey> getPublicKeys(KeyIdentifier identifier)
isUserTagback to summary
private static boolean isUserTag(int tag)
readOptionalTrustPacketback to summary
pack-priv static TrustPacket readOptionalTrustPacket(BCPGInputStream pIn) throws IOException
readSignaturesAndTrustback to summary
pack-priv static List<PGPSignature> readSignaturesAndTrust(BCPGInputStream pIn) throws IOException
readUserIDsback to summary
pack-priv static void readUserIDs(BCPGInputStream pIn, List<UserDataPacket> ids, List<TrustPacket> idTrusts, List<List<PGPSignature>> idSigs) throws IOException
sizeback to summary
public abstract int size()

Return the number of keys in the key ring.

Returns:int

number of keys (master key + subkey).