Class PgpLiteralDataGenerator
- Namespace
- Org.BouncyCastle.Bcpg.OpenPgp
- Assembly
- BouncyCastle.Cryptography.dll
public class PgpLiteralDataGenerator : IStreamGenerator
- Inheritance
-
PgpLiteralDataGenerator
- Implements
- Inherited Members
Remarks
Class for producing literal data packets.
Constructors
PgpLiteralDataGenerator()
public PgpLiteralDataGenerator()
PgpLiteralDataGenerator(bool)
Generates literal data objects in the old format. This is important if you need compatibility with PGP 2.6.x.
public PgpLiteralDataGenerator(bool oldFormat)
Parameters
oldFormatboolIf true, uses old format.
Fields
Binary
public const char Binary = 'b'
Field Value
Console
The special name indicating a "for your eyes only" packet.
public const string Console = "_CONSOLE"
Field Value
Text
public const char Text = 't'
Field Value
Utf8
public const char Utf8 = 'u'
Field Value
Methods
Close()
[Obsolete("Dispose any opened Stream directly")]
public void Close()
Open(Stream, char, FileInfo)
Open a literal data packet for the passed in FileInfo object, returning
an output stream for saving the file contents.
The stream created can be closed off by either calling Close()
on the stream or Close() on the generator. Closing the returned
stream does not close off the Stream parameter outStr.
public Stream Open(Stream outStr, char format, FileInfo file)
Parameters
outStrStreamThe stream we want the packet in.
formatcharThe format we are using.
fileFileInfoThe
FileInfoobject containg the packet details.
Returns
Open(Stream, char, string, DateTime, byte[])
Open a literal data packet, returning a stream to store the data inside the packet, as an indefinite length stream. The stream is written out as a series of partial packets with a chunk size determined by the size of the passed in buffer.
The stream created can be closed off by either calling Close()
on the stream or Close() on the generator. Closing the returned
stream does not close off the Stream parameter outStr.
Note: if the buffer is not a power of 2 in length only the largest power of 2 bytes worth of the buffer will be used.
public Stream Open(Stream outStr, char format, string name, DateTime modificationTime, byte[] buffer)
Parameters
outStrStreamThe stream we want the packet in.
formatcharThe format we are using.
namestringThe name of the 'file'.
modificationTimeDateTimeThe time of last modification we want stored.
bufferbyte[]The buffer to use for collecting data to put into chunks.
Returns
Open(Stream, char, string, long, DateTime)
Open a literal data packet, returning a stream to store the data inside the packet.
The stream created can be closed off by either calling Close()
on the stream or Close() on the generator. Closing the returned
stream does not close off the Stream parameter outStr.
public Stream Open(Stream outStr, char format, string name, long length, DateTime modificationTime)
Parameters
outStrStreamThe stream we want the packet in.
formatcharThe format we are using.
namestringThe name of the 'file'.
lengthlongThe length of the data we will write.
modificationTimeDateTimeThe time of last modification we want stored.