C# Class Brunet.Security.SecurityDataMessage

Parses and creates SecurityDataMessages. In general this class is not thread-safe.
The format for said packets is: [security params][epoch][seqid][encrypted [data length][data][signature]]
Inheritance: DataPacket
Show file Open project: johnynek/brunet Class Usage Examples

Protected Properties

Property Type Description
_data MemBlock
_encrypted_data MemBlock
_epoch int
_seqid int
_signature MemBlock
_spi int

Public Methods

Method Description
Decrypt ( SymmetricEncryption se ) : bool

Decrypts the packet given a SymmetricEncryption returning true if it was able to decrypt it.

Encrypt ( SymmetricEncryption se ) : void

Encrypts the packet given a SymmetricEncryption.

SecurityDataMessage ( ) : Brunet
SecurityDataMessage ( MemBlock data ) : Brunet
Sign ( HashAlgorithm hash ) : void

Signs a packet given a Hash algorithm.

Verify ( HashAlgorithm hash ) : bool

Verifies the packet given a Hash algorithm.

Protected Methods

Method Description
UpdatePacket ( ) : void

Method Details

Decrypt() public method

Decrypts the packet given a SymmetricEncryption returning true if it was able to decrypt it.
public Decrypt ( SymmetricEncryption se ) : bool
se SymmetricEncryption
return bool

Encrypt() public method

Encrypts the packet given a SymmetricEncryption.
public Encrypt ( SymmetricEncryption se ) : void
se SymmetricEncryption
return void

SecurityDataMessage() public method

public SecurityDataMessage ( ) : Brunet
return Brunet

SecurityDataMessage() public method

public SecurityDataMessage ( MemBlock data ) : Brunet
data MemBlock
return Brunet

Sign() public method

Signs a packet given a Hash algorithm.
public Sign ( HashAlgorithm hash ) : void
hash System.Security.Cryptography.HashAlgorithm
return void

UpdatePacket() protected method

protected UpdatePacket ( ) : void
return void

Verify() public method

Verifies the packet given a Hash algorithm.
public Verify ( HashAlgorithm hash ) : bool
hash System.Security.Cryptography.HashAlgorithm
return bool

Property Details

_data protected property

protected MemBlock _data
return MemBlock

_encrypted_data protected property

protected MemBlock _encrypted_data
return MemBlock

_epoch protected property

protected int _epoch
return int

_seqid protected property

protected int _seqid
return int

_signature protected property

protected MemBlock _signature
return MemBlock

_spi protected property

protected int _spi
return int