Skip to content

@pqc-sdk/core / serialize

Function: serialize() ​

serialize(key): string

Serializes a key to a portable string: pqcv1.<algorithm>.<use>.<base64url>.

Parameters ​

key ​

PqcKey

Returns ​

string

Example ​

ts
import { pqc } from '@pqc-sdk/core';

const pair = await pqc.keys.generate();
const token = pqc.keys.serialize(pair.publicKey);
// "pqcv1.ml-kem-768.public.h1q3…"