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

System.Security.Cryptography.HpkeRecipient

public abstract class HpkeRecipient : IDisposable
Represents an HPKE recipient context for decrypting multiple messages and exporting secrets.
public HpkeSuite Suite { get; }

Gets the cipher suite associated with this recipient.

protected HpkeRecipient(HpkeSuite suite)

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

public void Dispose()

Releases all resources used by the HpkeRecipient class.

protected virtual void Dispose(bool disposing)

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

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

Derives an exported secret from this recipient context.

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

Derives an exported secret from this recipient context.

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

Derives an exported secret from this recipient 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 recipient context.

public byte[] Open(ReadOnlySpan<byte> ciphertext, ReadOnlySpan<byte> associatedData = default)

Decrypts and authenticates a message using this recipient context.

public byte[] Open(byte[] ciphertext, byte[] associatedData = null)

Decrypts and authenticates a message using this recipient context.

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

Decrypts and authenticates a message into the provided buffer using this recipient context.

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

When overridden in a derived class, decrypts and authenticates a message using this recipient context.