Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 993 Bytes

_types_d_.keylike.md

File metadata and controls

17 lines (13 loc) · 993 Bytes

Type alias: KeyLike

Ƭ KeyLike: KeyObject | CryptoKey | Uint8Array

Defined in src/types.d.ts:96

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.