public class PGPObjectFactory extends Object implements Iterable
Note: if this class finds a PGPPublicKey
or a PGPSecretKey
it will create a
PGPPublicKeyRing
, or a PGPSecretKeyRing
for each key found. If all you are trying
to do is read a key ring file use either PGPPublicKeyRingCollection
or
PGPSecretKeyRingCollection
.
This factory supports reading the following types of objects:
PacketTags.SIGNATURE
- produces a PGPSignatureList
PacketTags.SECRET_KEY
- produces a PGPSecretKeyRing
PacketTags.PUBLIC_KEY
- produces a PGPPublicKeyRing
PacketTags.PUBLIC_SUBKEY
- produces a PGPPublicKey
PacketTags.COMPRESSED_DATA
- produces a PGPCompressedData
PacketTags.LITERAL_DATA
- produces a PGPLiteralData
PacketTags.PUBLIC_KEY_ENC_SESSION
- produces a PGPEncryptedDataList
PacketTags.SYMMETRIC_KEY_ENC_SESSION
- produces a PGPEncryptedDataList
PacketTags.ONE_PASS_SIGNATURE
- produces a PGPOnePassSignatureList
PacketTags.MARKER
- produces a PGPMarker
Constructor and Description |
---|
PGPObjectFactory(byte[] bytes,
KeyFingerPrintCalculator fingerPrintCalculator)
Create an object factory suitable for reading PGP objects such as keys, key rings and key
ring collections, or PGP encrypted data.
|
PGPObjectFactory(InputStream in,
KeyFingerPrintCalculator fingerPrintCalculator)
Create an object factory suitable for reading PGP objects such as keys, key rings and key
ring collections, or PGP encrypted data.
|
Modifier and Type | Method and Description |
---|---|
Iterator |
iterator()
Support method for Iterable where available.
|
Object |
nextObject()
Return the next object in the stream, or
null if the end of stream is reached. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public PGPObjectFactory(InputStream in, KeyFingerPrintCalculator fingerPrintCalculator)
in
- stream to read PGP data from.fingerPrintCalculator
- calculator to use in key finger print calculations.public PGPObjectFactory(byte[] bytes, KeyFingerPrintCalculator fingerPrintCalculator)
bytes
- PGP encoded data.fingerPrintCalculator
- calculator to use in key finger print calculations.public Object nextObject() throws IOException
null
if the end of stream is reached.IOException
- if an error occurs reading from the wrapped stream or parsing data.Copyright © 2018 BouncyCastle.org. All rights reserved.