mirror of
https://github.com/danbulant/jose
synced 2026-05-25 04:51:47 +00:00
1 KiB
1 KiB
Type alias: KeyLike
types.KeyLike
Ƭ KeyLike: KeyObject | CryptoKey | Uint8Array
KeyLike are platform-specific references to keying material.
- KeyObject instances come from node's crypto module (see crypto.generateKeyPair, crypto.createPublicKey, crypto.createPrivateKey, crypto.createSecretKey).
- CryptoKey instances come from Web Cryptography API (see SubtleCrypto.importKey, SubtleCrypto.generateKey, SubtleCrypto.deriveKey, SubtleCrypto.unwrapKey).
- Uint8Array is used exclusively for symmetric secret representations, a CryptoKey or KeyObject is preferred, but in Web Crypto API this isn't an option for some algorithms.
Defined in: types.d.ts:96