Method Seal
- Namespace
- MailFathom.Common
- Assembly
- MailFathom.Common.dll
Seal(ReadOnlySpan<byte>, ReadOnlySpan<byte>, ReadOnlySpan<byte>)
Seals a value.
public static byte[] Seal(ReadOnlySpan<byte> key, ReadOnlySpan<byte> plaintext, ReadOnlySpan<byte> associatedData)
Parameters
keyReadOnlySpan<byte>The key, of KeySizeInBytes bytes.
plaintextReadOnlySpan<byte>The value to seal.
associatedDataReadOnlySpan<byte>What the sealed value is bound to, authenticated but not encrypted.
Returns
- byte[]
The sealed value.
Exceptions
- ArgumentException
Thrown when the key is not KeySizeInBytes bytes.
- CryptographicException
Thrown when the platform refuses the operation.