private InternalEncryptAndWrapMessage ( ContentType contentType, NetMQMessage plainMessage ) : NetMQMessage | ||
contentType | ContentType | This identifies the type of content: ChangeCipherSpec, Handshake, or ApplicationData. |
plainMessage | NetMQMessage | The unencrypted form of the message to be encrypted. |
return | NetMQMessage |
internal NetMQMessage InternalEncryptAndWrapMessage(ContentType contentType, NetMQMessage plainMessage)
{
NetMQMessage encryptedMessage = m_recordLayer.EncryptMessage(contentType, plainMessage);
encryptedMessage.Push(new byte[] { (byte)contentType });
encryptedMessage.Push(m_protocolVersion);
return encryptedMessage;
}
/// <summary> /// Add the given NetMQMessage to the list that this object holds, using the SecureChannel to /// encrypt and wrap it as a ChangeCipherSpec type of content. /// </summary> /// <param name="message">the NetMQMessage to add to the list that this object is holding</param> public void AddCipherChangeMessage(NetMQMessage message) { m_messages.Add(m_secureChannel.InternalEncryptAndWrapMessage(ContentType.ChangeCipherSpec, message)); }