Skip to content

deriveKey

deriveKey(instance, options): Promise<CryptoKey>

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

Derives a symmetric encryption key 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 fails.

Instance

The instance of the active Keyring when using pubKey.

EncryptOptions

The full options to be used.

Promise<CryptoKey>

The derived crypto key as a promise.