jose/docs/types/types.keylike.md
2021-03-24 13:42:12 +01:00

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