|
Bouncy Castle Cryptography 1.65 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.bouncycastle.openpgp.PGPKeyRing | +--org.bouncycastle.openpgp.PGPPublicKeyRing
Class to hold a single master public key and its subkeys.
Often PGP keyring files consist of multiple master keys, if you are trying to process or construct one of these you should use the PGPPublicKeyRingCollection class.
Constructor Summary | |
PGPPublicKeyRing(byte[] encoding,
org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator fingerPrintCalculator)
|
|
PGPPublicKeyRing(java.io.InputStream in,
org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator fingerPrintCalculator)
|
|
PGPPublicKeyRing(java.util.List pubKeys)
Base constructor from a list of keys representing a public key ring (a master key and its associated sub-keys). |
Method Summary | |
void |
encode(java.io.OutputStream outStream)
|
void |
encode(java.io.OutputStream outStream,
boolean forTransfer)
Encode the key ring to outStream, with trust packets stripped out if forTransfer is true. |
byte[] |
getEncoded()
|
byte[] |
getEncoded(boolean forTransfer)
Return an encoding of the key ring, with trust packets stripped out if forTransfer is true. |
java.util.Iterator |
getKeysWithSignaturesBy(long keyID)
Return any keys carrying a signature issued by the key represented by keyID. |
PGPPublicKey |
getPublicKey()
Return the first public key in the ring. |
PGPPublicKey |
getPublicKey(byte[] fingerprint)
Return the public key with the passed in fingerprint if it is present. |
PGPPublicKey |
getPublicKey(long keyID)
Return the public key referred to by the passed in keyID if it is present. |
java.util.Iterator |
getPublicKeys()
Return an iterator containing all the public keys. |
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. |
java.util.Iterator |
iterator()
Support method for Iterable where available. |
static PGPPublicKeyRing |
removePublicKey(PGPPublicKeyRing pubRing,
PGPPublicKey pubKey)
Returns a new key ring with the public key passed in removed from the key ring. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public PGPPublicKeyRing(byte[] encoding, org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator fingerPrintCalculator) throws java.io.IOException
public PGPPublicKeyRing(java.util.List pubKeys)
pubKeys
- the list of keys making up the ring.public PGPPublicKeyRing(java.io.InputStream in, org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator fingerPrintCalculator) throws java.io.IOException
Method Detail |
public PGPPublicKey getPublicKey()
public PGPPublicKey getPublicKey(long keyID)
keyID
- the full keyID of the key of interest.public PGPPublicKey getPublicKey(byte[] fingerprint)
fingerprint
- the full fingerprint of the key of interest.public java.util.Iterator getKeysWithSignaturesBy(long keyID)
keyID
- the key id to be matched against.public java.util.Iterator getPublicKeys()
public java.util.Iterator iterator()
public byte[] getEncoded() throws java.io.IOException
public byte[] getEncoded(boolean forTransfer) throws java.io.IOException
forTransfer
- if the purpose of encoding is to send key to other users.public void encode(java.io.OutputStream outStream) throws java.io.IOException
public void encode(java.io.OutputStream outStream, boolean forTransfer) throws java.io.IOException
outStream
- stream to write the key encoding to.forTransfer
- if the purpose of encoding is to send key to other users.public static PGPPublicKeyRing insertPublicKey(PGPPublicKeyRing pubRing, PGPPublicKey pubKey)
pubRing
- the public key ring to be modifiedpubKey
- the public key to be inserted.public static PGPPublicKeyRing removePublicKey(PGPPublicKeyRing pubRing, PGPPublicKey pubKey)
pubRing
- the public key ring to be modifiedpubKey
- the public key to be removed.
|
Bouncy Castle Cryptography 1.65 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |