<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />

TlsCipher

public interface TlsCipher
Base interface for a TLS bulk cipher.
bool UsesOpaqueRecordType { get; }

TlsDecodeResult DecodeCiphertext(long seqNo, short recordType, ProtocolVersion recordVersion, byte[] ciphertext, int offset, int len)

Decode the passed in ciphertext using the current bulk cipher.

TlsEncodeResult EncodePlaintext(long seqNo, short contentType, ProtocolVersion recordVersion, int headerAllocation, byte[] plaintext, int offset, int len)

Encode the passed in plaintext using the current bulk cipher.

int GetCiphertextDecodeLimit(int plaintextLimit)

Return the maximum input size for a ciphertext given a maximum output size for the plaintext of plaintextLimit bytes.

int GetCiphertextEncodeLimit(int plaintextLength, int plaintextLimit)

Return the maximum output size for a ciphertext given an actual input plaintext size of plaintextLength bytes and a maximum input plaintext size of plaintextLimit bytes.

int GetPlaintextLimit(int ciphertextLimit)

Return the maximum size for the plaintext given ciphertextlimit bytes of ciphertext.

void RekeyDecoder()

void RekeyEncoder()