Skip to content

importWrappingKey

importWrappingKey(bytes): Promise<WrappingKey>

Defined in: src/codecs/wrapped/key.ts:62

Import raw operator secret bytes into a WrappingKey handle.

The bytes are HKDF input keying material, not raw AES or HMAC keys: the codec derives an AES-256 subkey and an HMAC-SHA-256 subkey via HKDF under the labels @smonn/ids/wrapped/aes and @smonn/ids/wrapped/hmac. Accepts 16, 24, or 32 bytes; the input size sets the entropy floor only — a 16-byte handle still yields AES-256 and HMAC-SHA-256 subkeys with a 128-bit entropy floor. To store or transport key material, use encodeWrappingKey / decodeWrappingKey ("hex" or "base64url" — not Crockford base32).

Uint8Array

16, 24, or 32 raw key bytes.

Promise<WrappingKey>

invalid_key_length if bytes.length is not 16, 24, or 32.