encrypt
encrypt(
plaintext,options):Promise<Uint8Array<ArrayBufferLike>>
Defined in: packages/filecoin-encryption-envelope/src/aes-gcm.ts:116
Encrypt a complete plaintext as scheme 1 and return envelope || ciphertext.
Caller-owned byte arrays are snapshotted before the first async step to prevent them from changing during the operation. The IV is always generated internally and cannot be provided by the caller.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
plaintext | Uint8Array |
options | EncryptOptions |
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>