The AesGcmParams object represents the object that should be passed as the algorithm parameter into the encrypt and decrypt operation when using the AES-GCM algorithm.
For more details, head to the MDN Web Crypto API documentation on AES-GCM.
Properties
Property | Type | Description |
---|---|---|
name | string | Should be set to AES-GCM. |
iv | ArrayBuffer, TypedArray, or DataView | The initialization vector. It must be 12 bytes long, unpredictable and cryptographically random. It must be unique for every encryption operation carried out with a given key. Never reuse an iv with the same key. Yet, it doesn't need to be secret and can be transmitted along with the ciphertext. |
additionalData (optional) | ArrayBuffer, TypedArray or DataView | Additional data that should be authenticated, but not encrypted. It must be included in the calculation of the authentication tag, but not encrypted itself. |
tagLength (optional) | number | The length of the authentication tag in bits. Should be set, and will default to 96. |
Example
example-webcrypto-aesgcmparams.js