C# Класс NetMQ.Security.V0_1.SecureChannel

Наследование: ISecureChannel
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
InternalEncryptAndWrapMessage NetMQMessage
OnCipherSuiteChangeFromHandshakeLayer void

Открытые методы

Метод Описание
DecryptApplicationMessage ( [ cipherMessage ) : NetMQMessage

Decrypt the given NetMQMessage, the first frame of which is assumed to contain the protocol version.

Dispose ( ) : void

Release any contained resources of this SecureChannel object.

This disposes of the handshake-layer and the record-layer.

EncryptApplicationMessage ( [ plainMessage ) : NetMQMessage

Encrypt the given NetMQMessage, wrapping it's content as application-data and preficing it with the encryption protocol.

ProcessMessage ( NetMQMessage incomingMessage, IList outgoingMesssages ) : bool

Process handshake and change cipher suite messages. This method should be called for every incoming message until the method returns true. You cannot encrypt or decrypt messages until the method return true. Each call to the method may include outgoing messages that need to be sent to the other peer.

Note: Within this library, this method is ONLY called from within the unit-tests.

SecureChannel ( ConnectionEnd connectionEnd ) : System

Create a new SecureChannel with the given ConnectionEnd.

SetVerifyCertificate ( VerifyCertificateDelegate verifyCertificate ) : void

Assign the delegate to use to verify the X.509 certificate.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Release any contained resources of this SecureChannel object.

This disposes of the handshake-layer and the record-layer.

Приватные методы

Метод Описание
InternalEncryptAndWrapMessage ( ContentType contentType, NetMQMessage plainMessage ) : NetMQMessage
OnCipherSuiteChangeFromHandshakeLayer ( object sender, EventArgs e ) : void

Описание методов

DecryptApplicationMessage() публичный Метод

Decrypt the given NetMQMessage, the first frame of which is assumed to contain the protocol version.
cipherMessage must not be null. NetMQSecurityErrorCode.SecureChannelNotReady: The secure channel must be ready. NetMQSecurityErrorCode.InvalidFramesCount: The cipher message must have at least 2 frames. NetMQSecurityErrorCode.InvalidProtocolVersion: The protocol must be the correct version. NetMQSecurityErrorCode.InvalidContentType: The message must contain application data.
public DecryptApplicationMessage ( [ cipherMessage ) : NetMQMessage
cipherMessage [ the NetMQMessage to decrypt
Результат NetMQMessage

Dispose() публичный Метод

Release any contained resources of this SecureChannel object.
This disposes of the handshake-layer and the record-layer.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Release any contained resources of this SecureChannel object.
This disposes of the handshake-layer and the record-layer.
protected Dispose ( bool disposing ) : void
disposing bool set this to true if disposing of managed resources
Результат void

EncryptApplicationMessage() публичный Метод

Encrypt the given NetMQMessage, wrapping it's content as application-data and preficing it with the encryption protocol.
plainMessage must not be null. NetMQSecurityErrorCode.SecureChannelNotReady: The secure channel must be ready.
public EncryptApplicationMessage ( [ plainMessage ) : NetMQMessage
plainMessage [ The unencrypted form of the message to be encrypted.
Результат NetMQMessage

ProcessMessage() публичный Метод

Process handshake and change cipher suite messages. This method should be called for every incoming message until the method returns true. You cannot encrypt or decrypt messages until the method return true. Each call to the method may include outgoing messages that need to be sent to the other peer.
Note: Within this library, this method is ONLY called from within the unit-tests.
NetMQSecurityErrorCode.InvalidContentType: Unknown content type. NetMQSecurityErrorCode.InvalidFrameLength: Wrong length for protocol version frame. NetMQSecurityErrorCode.InvalidFrameLength: Wrong length for message size. NetMQSecurityErrorCode.InvalidProtocolVersion: Wrong protocol version.
public ProcessMessage ( NetMQMessage incomingMessage, IList outgoingMesssages ) : bool
incomingMessage NetMQMessage the incoming message from the other peer
outgoingMesssages IList the list of outgoing messages that need to be sent to the other peer
Результат bool

SecureChannel() публичный Метод

Create a new SecureChannel with the given ConnectionEnd.
public SecureChannel ( ConnectionEnd connectionEnd ) : System
connectionEnd ConnectionEnd the ConnectionEnd that this channel is to talk to
Результат System

SetVerifyCertificate() публичный Метод

Assign the delegate to use to verify the X.509 certificate.
public SetVerifyCertificate ( VerifyCertificateDelegate verifyCertificate ) : void
verifyCertificate VerifyCertificateDelegate
Результат void