Sylloge
A C# helper library
Public Types | Public Member Functions | Properties
Sylloge.Encryption.BinaryStream Class Reference

Inherited by Sylloge.Encryption.Aes.DecryptStream, Sylloge.Encryption.Aes.EncryptStream, Sylloge.Encryption.TripleDES.DecryptStream, and Sylloge.Encryption.TripleDES.EncryptStream.

List of all members.

Public Types

enum  StreamType { Encrypt, Decrypt }
 Defines the type method to which the stream will handle data (encrypt or decrypt) More...
enum  AlgorithmType { AES, AES_Rijndael, TripleDES }
 Defines the algorithm type used by the stream. More...

Public Member Functions

 BinaryStream (AlgorithmType algo, StreamType type, int blockSize, int keySize, string pass, byte[] salt)
 BinaryStream (AlgorithmType algo, StreamType type, int blockSize, int keySize, string pass, byte[] salt, CryptoStreamMode mode)
 BinaryStream (AlgorithmType algo, StreamType type, int blockSize, int keySize, byte[] key, byte[] iv)
 BinaryStream (AlgorithmType algo, StreamType type, int blockSize, int keySize, byte[] key, byte[] iv, CryptoStreamMode mode)
void Close ()
void Dispose ()
 Releases the unmanaged resources used by the stream and optionally releases the managed resources.
void Flush ()
 Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
int Read (byte[] buffer, int offset, int count)
 Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
int ReadByte ()
 Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.
void WriteByte (byte value)
 Writes a byte to the current position in the stream and advances the position within the stream by one byte.
void Write (byte[] buffer)
 Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
void Write (byte[] buffer, int offset, int count)
 Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
byte[] ToArray ()
 Returns the underlying stream data as a byte array.

Properties

StreamType Type [get, set]
 Gets the type of encryption stream this is (encryptor or decryptor)
AlgorithmType Algorithm [get, set]
 Gets the current algorithm this encryption stream is using.
bool CanRead [get]
 Gets a value indicating whether the current stream is readable.
bool CanWrite [get]
 Gets a value indicating whether the current stream is writeable.

Detailed Description

Definition at line 9 of file BinaryStream.cs.


Member Enumeration Documentation

Defines the algorithm type used by the stream.

Enumerator:
AES 

Defines the AES algorithm will be used.

AES_Rijndael 

Defines the AES (Rijndael) algorithm will be used.

TripleDES 

Defines the TripleDES algorithm will be used.

Definition at line 30 of file BinaryStream.cs.

Defines the type method to which the stream will handle data (encrypt or decrypt)

Enumerator:
Encrypt 

Defines an encrypting stream.

Decrypt 

Defines a decrypting stream.

Definition at line 15 of file BinaryStream.cs.


Constructor & Destructor Documentation

Sylloge.Encryption.BinaryStream.BinaryStream ( AlgorithmType  algo,
StreamType  type,
int  blockSize,
int  keySize,
string  pass,
byte[]  salt 
)

Definition at line 59 of file BinaryStream.cs.

Sylloge.Encryption.BinaryStream.BinaryStream ( AlgorithmType  algo,
StreamType  type,
int  blockSize,
int  keySize,
string  pass,
byte[]  salt,
CryptoStreamMode  mode 
)

Definition at line 67 of file BinaryStream.cs.

Sylloge.Encryption.BinaryStream.BinaryStream ( AlgorithmType  algo,
StreamType  type,
int  blockSize,
int  keySize,
byte[]  key,
byte[]  iv 
)

Definition at line 75 of file BinaryStream.cs.

Sylloge.Encryption.BinaryStream.BinaryStream ( AlgorithmType  algo,
StreamType  type,
int  blockSize,
int  keySize,
byte[]  key,
byte[]  iv,
CryptoStreamMode  mode 
)

Definition at line 80 of file BinaryStream.cs.


Member Function Documentation

void Sylloge.Encryption.BinaryStream.Close ( )

Definition at line 101 of file BinaryStream.cs.

void Sylloge.Encryption.BinaryStream.Dispose ( )

Releases the unmanaged resources used by the stream and optionally releases the managed resources.

Definition at line 112 of file BinaryStream.cs.

void Sylloge.Encryption.BinaryStream.Flush ( )

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.

Definition at line 123 of file BinaryStream.cs.

int Sylloge.Encryption.BinaryStream.Read ( byte[]  buffer,
int  offset,
int  count 
)

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Parameters:
bufferAn array of bytes. A maximum of count bytes are read from the current stream and stored in buffer.
offsetThe byte offset in buffer at which to begin storing the data read from the current stream.
countThe maximum number of bytes to be read from the current stream.
Returns:
The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero if the end of the stream has been reached.

Definition at line 137 of file BinaryStream.cs.

int Sylloge.Encryption.BinaryStream.ReadByte ( )

Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.

Returns:
The unsigned byte cast to an Int32, or -1 if at the end of the stream.

Definition at line 147 of file BinaryStream.cs.

byte [] Sylloge.Encryption.BinaryStream.ToArray ( )

Returns the underlying stream data as a byte array.

Returns:
The underlying stream data as a byte array

Definition at line 191 of file BinaryStream.cs.

void Sylloge.Encryption.BinaryStream.Write ( byte[]  buffer)

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

Parameters:
bufferThis method copies count bytes from buffer to the current stream.

Definition at line 166 of file BinaryStream.cs.

void Sylloge.Encryption.BinaryStream.Write ( byte[]  buffer,
int  offset,
int  count 
)

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

Parameters:
bufferThis method copies count bytes from buffer to the current stream.
offsetThe byte offset in buffer at which to begin copying bytes to the current stream
countThe number of bytes to be written to the current stream.

Definition at line 179 of file BinaryStream.cs.

void Sylloge.Encryption.BinaryStream.WriteByte ( byte  value)

Writes a byte to the current position in the stream and advances the position within the stream by one byte.

Parameters:
valueThe byte to write to the stream.

Definition at line 156 of file BinaryStream.cs.


Property Documentation

AlgorithmType Sylloge.Encryption.BinaryStream.Algorithm [get, set]

Gets the current algorithm this encryption stream is using.

Definition at line 57 of file BinaryStream.cs.

bool Sylloge.Encryption.BinaryStream.CanRead [get]

Gets a value indicating whether the current stream is readable.

Definition at line 89 of file BinaryStream.cs.

bool Sylloge.Encryption.BinaryStream.CanWrite [get]

Gets a value indicating whether the current stream is writeable.

Definition at line 97 of file BinaryStream.cs.

StreamType Sylloge.Encryption.BinaryStream.Type [get, set]

Gets the type of encryption stream this is (encryptor or decryptor)

Definition at line 53 of file BinaryStream.cs.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events