Table of Contents

Class EncryptedSession

Namespace
The.RPC
Assembly
Instagile.dll

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

deadline DateTime

Session is valid until this instant.

encryptStreams bool

If true, streams will be chunked for encrypting at a small cost in latency and memory.

isLegacy bool

Whether entity metadata is in legacy mode.

allowUnencryptedMessages bool

Whether the client should permit messages that the server didn't encrypt.

algorithm IAeadAlgorithm

Instance of an AEAD primitive for ciphering+binding.

binding byte[]

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

IAeadAlgorithm

AllowUnencryptedMessages

public readonly bool AllowUnencryptedMessages

Field Value

bool

Deadline

public readonly DateTime Deadline

Field Value

DateTime

EncryptStreams

public readonly bool EncryptStreams

Field Value

bool

IsLegacy

public readonly bool IsLegacy

Field Value

bool

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

appVersion string
environmentName string
enforceVersionMatch bool

Returns

byte[]

DecryptAsync(byte[], Stream?)

public Task<(byte[], Stream?)> DecryptAsync(byte[] header, Stream? trailer)

Parameters

header byte[]
trailer Stream

Returns

Task<(byte[], Stream)>

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)

Parameters

header byte[]
trailer Stream

Returns

Task<(byte[], Stream)>