Class EncryptedSession
Manages an encrypted session for secure RPC communication, handling encryption and decryption of packets and streams.
public sealed class EncryptedSession : IDisposable
- Inheritance
-
EncryptedSession
- Implements
- Inherited Members
Constructors
EncryptedSession(DateTime, bool, bool, bool, IAeadAlgorithm, byte[])
public EncryptedSession(DateTime deadline, bool encryptStreams, bool isLegacy, bool allowUnencryptedMessages, IAeadAlgorithm algorithm, byte[] binding)
Parameters
deadlineDateTimeSession is valid until this instant.
encryptStreamsboolIf true, streams will be chunked for encrypting at a small cost in latency and memory.
isLegacyboolWhether entity metadata is in legacy mode.
allowUnencryptedMessagesboolWhether the client should permit messages that the server didn't encrypt.
algorithmIAeadAlgorithmInstance of an AEAD primitive for ciphering+binding.
bindingbyte[]Authenticated with every message, so that messages only open in the same protocol context; see CreateBinding(string, string, bool).
Fields
Algorithm
public readonly IAeadAlgorithm Algorithm
Field Value
AllowUnencryptedMessages
public readonly bool AllowUnencryptedMessages
Field Value
Deadline
public readonly DateTime Deadline
Field Value
EncryptStreams
public readonly bool EncryptStreams
Field Value
IsLegacy
public readonly bool IsLegacy
Field Value
Methods
CreateBinding(string, string, bool)
Identify the protocol pairing, which is each release of each application in each environment.
public static byte[] CreateBinding(string appVersion, string environmentName, bool enforceVersionMatch)
Parameters
Returns
- byte[]
DecryptAsync(byte[], Stream?)
public Task<(byte[], Stream?)> DecryptAsync(byte[] header, Stream? trailer)
Parameters
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
EncryptAsync(byte[], Stream?)
public Task<(byte[], Stream?)> EncryptAsync(byte[] header, Stream? trailer)