decodeOpaqueKey
decodeOpaqueKey(
encoded,format):Uint8Array
Defined in: src/codecs/opaque/key.ts:86
Decodes key material emitted by encodeOpaqueKey (or ids keygen) back to raw bytes.
Parameters
Section titled “Parameters”encoded
Section titled “encoded”string
Hex or base64url string.
format
Section titled “format”Must match how the string was encoded.
Returns
Section titled “Returns”Uint8Array
Throws
Section titled “Throws”invalid_key_format if format is not "hex" or "base64url".
Throws
Section titled “Throws”invalid_key_encoding if the string is malformed for its format.
Throws
Section titled “Throws”invalid_key_length if the decoded bytes are not 16, 24, or 32 bytes.