Table of Contents

Method Open

Namespace
MailFathom.Common
Assembly
MailFathom.Common.dll

Open(ReadOnlySpan<byte>, ReadOnlySpan<byte>, ReadOnlySpan<byte>)

Opens a sealed value.

public static byte[] Open(ReadOnlySpan<byte> key, ReadOnlySpan<byte> sealedValue, ReadOnlySpan<byte> associatedData)

Parameters

key ReadOnlySpan<byte>

The key it was sealed with.

sealedValue ReadOnlySpan<byte>

The sealed value.

associatedData ReadOnlySpan<byte>

What it was bound to when it was sealed.

Returns

byte[]

The value.

Exceptions

ArgumentException

Thrown when the key is not KeySizeInBytes bytes.

CryptographicException

Thrown when the value was sealed with another key, bound to other associated data, truncated, or altered. The four are one outcome on purpose: distinguishing them would tell an attacker which part of a forgery was wrong.