Skip to content

createSignedTimestampId

createSignedTimestampId<Brand>(brand, opts): SignedTimestampCodec<Brand>

Defined in: src/codecs/signed/index.ts:182

Construct a SignedTimestampCodec for brand.

opts.keys is a non-empty ordered signing keyring — the first entry is current (used by generate / generateAt); all entries are tried on verify / safeVerify; duplicate operator secrets are rejected at construction.

Brand extends string

Brand & ValidBrand<Brand>

SignedTimestampOptions

SignedTimestampCodec<Brand>

const key = await importSigningKey(new Uint8Array(32));
const usr = createSignedTimestampId("usr", { keys: [key] });
const id = await usr.generate(); // Id<"usr">
await usr.verify(id); // passes
usr.extractTimestamp(id); // Date — sync, timestamp is plaintext