Skip to content

encodeWrappingKey

encodeWrappingKey(bytes, format): string

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

Encode raw wrapping operator secret bytes for storage in env vars or secret managers.

Supports "hex" (lowercase) and "base64url". Output round-trips through decodeWrappingKey back to the original bytes.

Uint8Array

WrappingKeyFormat

string

invalid_key_format if format is not "hex" or "base64url".

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