C# Class Brunet.Security.PeerSec.PeerSecAssociation

This is the brains of the security system. Each SecurityAssociation represents a Secure connection via an ISender, such that two different ISenders would need their own PeerSecAssociation.
Inheritance: Brunet.SecurityAssociation
Show file Open project: pstjuste/brunet Class Usage Examples

Public Properties

Property Type Description
DHEWithCertificateAndCAsInHash WriteOnceIdempotent
DHEWithCertificateAndCAsOutHash WriteOnceIdempotent
DHEWithCertificateHash WriteOnceIdempotent
RDHE WriteOnceIdempotent
RemoteCookie WriteOnceIdempotent
TIMEOUT int

Protected Properties

Property Type Description
_active bool
_called_enable int
_called_start int
_current_epoch int
_current_sh Brunet.SecurityHandler
_dh Mono.Security.Cryptography.DiffieHellman
_hash_verified bool
_last_called_request_update System.DateTime
_last_epoch int
_last_update System.DateTime
_ldhe byte[]
_local_cert WriteOnceX509
_remote_cert WriteOnceX509
_spi int

Public Methods

Method Description
Close ( string reason ) : bool

This closes the SA and cleans up its state.

Enable ( ) : void

Enables the SA if it has been properly setup.

PeerSecAssociation ( ISender sender, Brunet.CertificateHandler ch, int spi ) : Brunet
Reset ( ) : void
Start ( ) : bool
ToString ( ) : string
TryReset ( ) : bool

This is called when we want to reset the state of the SA after an equivalent time of two timeouts has occurred.

VerifyRequest ( MemBlock hash ) : bool

Verifies the hash with the DHEWithCertificateHash.

VerifyResponse ( MemBlock hash ) : bool

Verifies the hash to the DHEWithCertificateAndCAsOutHash.

Protected Methods

Method Description
HandleIncoming ( MemBlock data, MemBlock &app_data ) : bool

All incoming data filters through here.

HandleOutgoing ( ICopyable app_data, ICopyable &data ) : bool

All outgoing data filters through here.

UpdateSH ( object o, EventArgs ea ) : void

This method listens for the SH to request an update and passes the message to the RequestUpdate event.

Method Details

Close() public method

This closes the SA and cleans up its state.
public Close ( string reason ) : bool
reason string
return bool

Enable() public method

Enables the SA if it has been properly setup.
public Enable ( ) : void
return void

HandleIncoming() protected method

All incoming data filters through here.
protected HandleIncoming ( MemBlock data, MemBlock &app_data ) : bool
data MemBlock
app_data MemBlock
return bool

HandleOutgoing() protected method

All outgoing data filters through here.
protected HandleOutgoing ( ICopyable app_data, ICopyable &data ) : bool
app_data ICopyable
data ICopyable
return bool

PeerSecAssociation() public method

public PeerSecAssociation ( ISender sender, Brunet.CertificateHandler ch, int spi ) : Brunet
sender ISender
ch Brunet.CertificateHandler
spi int
return Brunet

Reset() public method

public Reset ( ) : void
return void

Start() public method

public Start ( ) : bool
return bool

ToString() public method

public ToString ( ) : string
return string

TryReset() public method

This is called when we want to reset the state of the SA after an equivalent time of two timeouts has occurred.
public TryReset ( ) : bool
return bool

UpdateSH() protected method

This method listens for the SH to request an update and passes the message to the RequestUpdate event.
protected UpdateSH ( object o, EventArgs ea ) : void
o object
ea System.EventArgs
return void

VerifyRequest() public method

Verifies the hash with the DHEWithCertificateHash.
public VerifyRequest ( MemBlock hash ) : bool
hash MemBlock
return bool

VerifyResponse() public method

Verifies the hash to the DHEWithCertificateAndCAsOutHash.
public VerifyResponse ( MemBlock hash ) : bool
hash MemBlock
return bool

Property Details

DHEWithCertificateAndCAsInHash public property

public WriteOnceIdempotent DHEWithCertificateAndCAsInHash
return WriteOnceIdempotent

DHEWithCertificateAndCAsOutHash public property

public WriteOnceIdempotent DHEWithCertificateAndCAsOutHash
return WriteOnceIdempotent

DHEWithCertificateHash public property

public WriteOnceIdempotent DHEWithCertificateHash
return WriteOnceIdempotent

RDHE public property

Remote half of the DHE
public WriteOnceIdempotent RDHE
return WriteOnceIdempotent

RemoteCookie public property

public WriteOnceIdempotent RemoteCookie
return WriteOnceIdempotent

TIMEOUT public property

public int TIMEOUT
return int

_active protected property

protected bool _active
return bool

_called_enable protected property

protected int _called_enable
return int

_called_start protected property

protected int _called_start
return int

_current_epoch protected property

protected int _current_epoch
return int

_current_sh protected property

protected SecurityHandler,Brunet _current_sh
return Brunet.SecurityHandler

_dh protected property

protected DiffieHellman,Mono.Security.Cryptography _dh
return Mono.Security.Cryptography.DiffieHellman

_hash_verified protected property

protected bool _hash_verified
return bool

_last_called_request_update protected property

protected DateTime,System _last_called_request_update
return System.DateTime

_last_epoch protected property

protected int _last_epoch
return int

_last_update protected property

protected DateTime,System _last_update
return System.DateTime

_ldhe protected property

protected byte[] _ldhe
return byte[]

_local_cert protected property

protected WriteOnceX509 _local_cert
return WriteOnceX509

_remote_cert protected property

protected WriteOnceX509 _remote_cert
return WriteOnceX509

_spi protected property

protected int _spi
return int