function aesGcmDecryptBytes
aesGcmDecryptBytes(
ciphertext: Uint8Array,
keyBytes: Uint8Array,
webKey?: WebKeySource,
): Promise<Uint8Array>

AES-GCM decrypt with raw key bytes. The mirror of aesGcmEncryptBytes; note it measures the ciphertext, which carries the tag the plaintext does not.

Anything too short to hold a tag never came from this format, so it is rejected by name rather than left to fail as a bad tag — reading a tag out of it would take bytes from the wrong end of the value.

Parameters

ciphertext: Uint8Array
keyBytes: Uint8Array
optional
webKey: WebKeySource

Return Type

Promise<Uint8Array>

Usage

import { aesGcmDecryptBytes } from "docs/crypto.ts";