createWrappedKeyId
createWrappedKeyId<
Brand,Kind>(brand,opts):WrappedKeyCodec<Brand,Kind>
Defined in: src/codecs/wrapped/index.ts:276
Construct a WrappedKeyCodec for brand and the given kind.
opts.kind fixes the integer type at construction time — one brand, one
kind. opts.keys is a non-empty ordered wrapping keyring: the first entry
is current (used by wrap); all entries are tried on unwrap; duplicate
operator secrets are rejected at construction.
Type Parameters
Section titled “Type Parameters”Brand extends string
Kind extends WrappedKind
Parameters
Section titled “Parameters”Brand & ValidBrand<Brand>
WrappedKeyOptions<Kind>
Returns
Section titled “Returns”WrappedKeyCodec<Brand, Kind>
Example
Section titled “Example”const key = await importWrappingKey(new Uint8Array(32));const invoices = createWrappedKeyId("inv", { kind: "u32", keys: [key] });
const id = await invoices.wrap(42); // Id<"inv">await invoices.unwrap(id); // 42