<PackageReference Include="Microsoft.Bcl.Cryptography" Version="11.0.0-rc.2.26504.105" />

System.Security.Cryptography.HpkeSender

public abstract class HpkeSender : IDisposable
Represents an HPKE sender context for encrypting multiple messages and exporting secrets.
public HpkeSuite Suite { get; }

Gets the cipher suite associated with this sender.

protected HpkeSender(HpkeSuite suite)

Initializes a new instance of the HpkeSender class with the specified cipher suite.

public void Dispose()

Releases all resources used by the HpkeSender class.

protected virtual void Dispose(bool disposing)

Releases the unmanaged resources used by this sender and optionally releases its managed resources.

public byte[] Export(ReadOnlySpan<byte> exporterContext, int length)

Derives an exported secret from this sender context.

public byte[] Export(byte[] exporterContext, int length)

Derives an exported secret from this sender context.

public void Export(ReadOnlySpan<byte> exporterContext, Span<byte> destination)

Derives an exported secret from this sender context into the provided buffer.

protected abstract void ExportCore(ReadOnlySpan<byte> exporterContext, Span<byte> destination)

When overridden in a derived class, derives an exported secret from this sender context.

public byte[] Seal(ReadOnlySpan<byte> plaintext, ReadOnlySpan<byte> associatedData = default)

Encrypts and authenticates a message using this sender context.

public byte[] Seal(byte[] plaintext, byte[] associatedData = null)

Encrypts and authenticates a message using this sender context.

public void Seal(ReadOnlySpan<byte> plaintext, Span<byte> ciphertext, ReadOnlySpan<byte> associatedData = default)

Encrypts and authenticates a message into the provided buffer using this sender context.

protected abstract void SealCore(ReadOnlySpan<byte> plaintext, Span<byte> ciphertext, ReadOnlySpan<byte> associatedData)

When overridden in a derived class, encrypts and authenticates a message using this sender context.