interface KeyOptions

Options to specify details for keys, i.e., the underlying algorithms.

Properties

optional
namedCurve: Crv

Choice of elliptic curve; relevant for ecdsa. Defaults to "P-256".

optional
hash: HashAlgorithm

Hash algorithm for internal use; relevant for "rsa-pss" and rsa-oaep". Defaults to "SHA-256".

optional
saltLength: number

Used by rsa-pss to make the signature more secure. Defaults to 32 and cannot be set externally.

optional
modulusLength: number

RSA key modulus, relevant to RSA keys. Can be 1024, 2048, or 4096. Defaults to 2048.

Usage

import { type KeyOptions } from ".";