Salmon
Loading...
Searching...
No Matches
Mku.Salmon.Header Class Reference

Header embedded in the AesStream. Header contains nonce and other information for decrypting the stream. More...

Public Member Functions

 Header (byte[] headerData)
 Construct a header from data.
 

Static Public Member Functions

static Header ReadHeaderData (Stream stream)
 Parse the header data from the stream.
 
static Header WriteHeader (Stream stream, byte[] nonce, int chunkSize)
 Write nonce and chunk size to the header.
 

Static Public Attributes

static readonly long HEADER_LENGTH = 16
 Header length.
 

Properties

byte[] MagicBytes = new byte[Generator.MAGIC_LENGTH] [get, set]
 Magic bytes.
 
byte Version [get, set]
 Format version from Generator.VERSION.
 
int ChunkSize [get, set]
 Chunk size used for data integrity.
 
byte[] Nonce [get, set]
 Starting nonce for the CTR mode. This is the upper part of the Counter.
 
byte[] HeaderData [get, set]
 Binary data.
 

Detailed Description

Header embedded in the AesStream. Header contains nonce and other information for decrypting the stream.

Constructor & Destructor Documentation

◆ Header()

Mku.Salmon.Header.Header ( byte[] headerData)

Construct a header from data.

Parameters
headerDataThe data

Member Function Documentation

◆ ReadHeaderData()

static Header Mku.Salmon.Header.ReadHeaderData ( Stream stream)
static

Parse the header data from the stream.

Parameters
streamThe stream.
Returns
The header
Exceptions
IOExceptionThrown if error during IO

◆ WriteHeader()

static Header Mku.Salmon.Header.WriteHeader ( Stream stream,
byte[] nonce,
int chunkSize )
static

Write nonce and chunk size to the header.

Parameters
stream
nonce
chunkSize
Returns
The new header that was written

The documentation for this class was generated from the following file: