C# Class Brunet.Security.SecurityAssociation

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 SecurityAssociation.
Inheritance: Brunet.SimpleSource, IDataHandler, ISender
显示文件 Open project: pstjuste/brunet Class Usage Examples

Public Properties

Property Type Description
Sender ISender

Protected Properties

Property Type Description
_ch CertificateHandler
_closed int
_receiving bool
_sending bool
_state States
_state_lock object

Public Methods

Method Description
CheckState ( ) : void

Close ( string reason ) : bool

This closes the SA and cleans up its state.

HandleData ( Brunet.MemBlock data, ISender return_path, object state ) : void

All incoming data filters through here.

SecurityAssociation ( ISender sender, CertificateHandler ch ) : Mono.Security.X509

Send ( ICopyable app_data ) : void

All outgoing data filters through here.

ToString ( ) : string
ToUri ( ) : string
Verify ( string id ) : bool

Protected Methods

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

HandleOutgoing ( ICopyable app_data, ICopyable &data ) : bool

UpdateState ( States next ) : void

UpdateState ( States current, States next ) : void
UpdateState ( States current, States next, bool if_current ) : void

Method Details

CheckState() public method

public CheckState ( ) : void
return void

Close() public method

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

HandleData() public method

All incoming data filters through here.
public HandleData ( Brunet.MemBlock data, ISender return_path, object state ) : void
data Brunet.MemBlock
return_path ISender
state object
return void

HandleIncoming() abstract protected method

abstract protected HandleIncoming ( Brunet.MemBlock data, Brunet.MemBlock &app_data ) : bool
data Brunet.MemBlock
app_data Brunet.MemBlock
return bool

HandleOutgoing() abstract protected method

abstract protected HandleOutgoing ( ICopyable app_data, ICopyable &data ) : bool
app_data ICopyable
data ICopyable
return bool

SecurityAssociation() public method

public SecurityAssociation ( ISender sender, CertificateHandler ch ) : Mono.Security.X509
sender ISender
ch CertificateHandler
return Mono.Security.X509

Send() public method

All outgoing data filters through here.
public Send ( ICopyable app_data ) : void
app_data ICopyable
return void

ToString() public method

public ToString ( ) : string
return string

ToUri() public method

public ToUri ( ) : string
return string

UpdateState() protected method

protected UpdateState ( States next ) : void
next States
return void

UpdateState() protected method

protected UpdateState ( States current, States next ) : void
current States
next States
return void

UpdateState() protected method

protected UpdateState ( States current, States next, bool if_current ) : void
current States
next States
if_current bool
return void

Verify() public method

public Verify ( string id ) : bool
id string
return bool

Property Details

Sender public_oe property

The insecure sender we send over.
public ISender Sender
return ISender

_ch protected_oe property

protected CertificateHandler _ch
return CertificateHandler

_closed protected_oe property

protected int _closed
return int

_receiving protected_oe property

protected bool _receiving
return bool

_sending protected_oe property

protected bool _sending
return bool

_state protected_oe property

protected States _state
return States

_state_lock protected_oe property

protected object _state_lock
return object