Table of Contents

Class AesGcmCipher

Namespace
NArk.ArkadeIntents.Lightning
Assembly
NArk.ArkadeIntents.dll

The platform implementation, used everywhere except the browser.

public sealed class AesGcmCipher : IAesGcmCipher
Inheritance
AesGcmCipher
Implements
Inherited Members

Methods

EncryptAsync(byte[], byte[], byte[], byte[], CancellationToken)

Encrypts plaintext under AES-256-GCM.

public Task<byte[]> EncryptAsync(byte[] key, byte[] nonce, byte[] plaintext, byte[] associatedData, CancellationToken cancellationToken = default)

Parameters

key byte[]

32-byte key.

nonce byte[]

12-byte nonce, never reused under the same key.

plaintext byte[]

What to encrypt.

associatedData byte[]

Authenticated but not encrypted.

cancellationToken CancellationToken

Cancels the operation.

Returns

Task<byte[]>

Ciphertext with the 16-byte authentication tag appended — the layout WebCrypto returns and the layout Go's aead.Seal produces, so an implementation that separates them must concatenate before returning.