C# Class Brunet.Security.PeerSec.SecurityControlMessage

Parses and creates SecurityControlMessages. In general, this class is not thread-safe.
The format for said packets is: [version][security params][message type][cookie local][cookie remote] [dhe length][dhe][cert length][cert][cas length][cas][signature] version, type, data length are integers the cookie and id sizes are static in a given environment the signature is static based upon the signature type
Show file Open project: pstjuste/brunet Class Usage Examples

Public Properties

Property Type Description
CALength int
CookieLength int
EmptyCookie MemBlock

Protected Properties

Property Type Description
_cas List
_certificate MemBlock
_dhe MemBlock
_hash MemBlock
_local_cookie MemBlock
_packet MemBlock
_remote_cookie MemBlock
_signature MemBlock
_spi int
_type MessageType
_update_packet bool
_version int

Public Methods

Method Description
SecurityControlMessage ( MemBlock data ) : Brunet
Sign ( RSACryptoServiceProvider rsa, HashAlgorithm hash ) : void

Signs a packet given a RSA key and a Hash algorithm.

ToString ( ) : string
Verify ( RSACryptoServiceProvider rsa, HashAlgorithm hash ) : bool

Verifies the packet given a RSA key and a Hash algorithm.

Protected Methods

Method Description
UpdatePacket ( ) : void

Writes the packet.

Private Methods

Method Description
SecurityControlMessage ( ) : Brunet

Method Details

SecurityControlMessage() public method

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

Sign() public method

Signs a packet given a RSA key and a Hash algorithm.
public Sign ( RSACryptoServiceProvider rsa, HashAlgorithm hash ) : void
rsa System.Security.Cryptography.RSACryptoServiceProvider
hash System.Security.Cryptography.HashAlgorithm
return void

ToString() public method

public ToString ( ) : string
return string

UpdatePacket() protected method

Writes the packet.
protected UpdatePacket ( ) : void
return void

Verify() public method

Verifies the packet given a RSA key and a Hash algorithm.
public Verify ( RSACryptoServiceProvider rsa, HashAlgorithm hash ) : bool
rsa System.Security.Cryptography.RSACryptoServiceProvider
hash System.Security.Cryptography.HashAlgorithm
return bool

Property Details

CALength public static property

public static int CALength
return int

CookieLength public static property

public static int CookieLength
return int

EmptyCookie public static property

public static MemBlock EmptyCookie
return MemBlock

_cas protected property

protected List _cas
return List

_certificate protected property

protected MemBlock _certificate
return MemBlock

_dhe protected property

protected MemBlock _dhe
return MemBlock

_hash protected property

protected MemBlock _hash
return MemBlock

_local_cookie protected property

protected MemBlock _local_cookie
return MemBlock

_packet protected property

protected MemBlock _packet
return MemBlock

_remote_cookie protected property

protected MemBlock _remote_cookie
return MemBlock

_signature protected property

protected MemBlock _signature
return MemBlock

_spi protected property

protected int _spi
return int

_type protected property

protected MessageType _type
return MessageType

_update_packet protected property

protected bool _update_packet
return bool

_version protected property

protected int _version
return int