Skip to content

decrypt

decrypt(payload, options, instance): Promise<ArrayBuffer>

Defined in: astrobase/src/encrypt/encrypt.ts:140

Decrypts the payload using the given options. Requires a key derivation input to be provided - one of EncryptOptions.passphrase or EncryptOptions.pubKey. If pubkey is provided, then the Identity’s private key must be available in the Keyring.

The promise will error if no key derivation input is provided or if key derivation or decryption fails.

BufferSource

The payload to decrypt.

EncryptOptions

The full options object.

Instance

The instance of the active Keyring when using pubKey.

Promise<ArrayBuffer>

The decrypted payload as a promise.