Options
All
  • Public
  • Public/Protected
  • All
Menu

HMAC-based Extract-and-Expand Key Derivation Function.

Implements HKDF from RFC5869.

Expands the given master key with salt and info into a limited stream of key material.

Hierarchy

  • HKDF

Index

Constructors

Methods

Constructors

  • new HKDF(hash: new () => Hash, key: Uint8Array, salt?: Uint8Array, info?: Uint8Array): HKDF
  • Create a new HKDF instance for the given hash function with the master key, optional salt, and info.

    • Master key is a high-entropy secret key (not a password).
    • Salt is a non-secret random value.
    • Info is application- and/or context-specific information.

    Parameters

    • hash: new () => Hash
        • new (): Hash
        • Returns Hash

    • key: Uint8Array
    • salt: Uint8Array = ...
    • Optional info: Uint8Array

    Returns HKDF

Methods

  • clean(): void
  • expand(length: number): Uint8Array
  • Expand returns next key material of the given length.

    It throws if expansion limit is reached (which is 254 digests of the underlying HMAC function).

    Parameters

    • length: number

    Returns Uint8Array

Generated using TypeDoc