Table of Contents

Class PgpObjectFactory

Namespace
Org.BouncyCastle.Bcpg.OpenPgp
Assembly
BouncyCastle.Cryptography.dll
public class PgpObjectFactory
Inheritance
PgpObjectFactory
Inherited Members

Remarks

General class for reading a PGP object stream.

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 PgpPublicKeyRingBundle or PgpSecretKeyRingBundle.

Constructors

PgpObjectFactory(byte[])

public PgpObjectFactory(byte[] bytes)

Parameters

bytes byte[]

PgpObjectFactory(Stream)

public PgpObjectFactory(Stream inputStream)

Parameters

inputStream Stream

Methods

AllPgpObjects()

Return all available objects in a list.

public IList<PgpObject> AllPgpObjects()

Returns

IList<PgpObject>

An IList containing all objects from this factory, in order.

FilterPgpObjects<T>()

Read all available objects, returning only those that are assignable to the specified type.

public IList<T> FilterPgpObjects<T>() where T : PgpObject

Returns

IList<T>

An IList<T> containing the filtered objects from this factory, in order.

Type Parameters

T

NextPgpObject()

Return the next object in the stream, or null if the end is reached.

public PgpObject NextPgpObject()

Returns

PgpObject

Exceptions

IOException

On a parse error