Skip to content

@pqc-sdk/core / generate

Function: generate()

Call Signature

generate(): Promise<KeyPair<"ml-kem-768">>

Generates a post-quantum key pair. With no options it generates ML-KEM-768, ready for pqc.encrypt.

Returns

Promise<KeyPair<"ml-kem-768">>

Example

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

const encryption = await pqc.keys.generate();
const signing = await pqc.keys.generate({ algorithm: 'ml-dsa-65' });

Call Signature

generate<A>(options): Promise<KeyPair<A>>

Generates a post-quantum key pair. With no options it generates ML-KEM-768, ready for pqc.encrypt.

Type Parameters

A

A extends Algorithm

Parameters

options

GenerateOptions<A> & object

Returns

Promise<KeyPair<A>>

Example

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

const encryption = await pqc.keys.generate();
const signing = await pqc.keys.generate({ algorithm: 'ml-dsa-65' });

Call Signature

generate(options?): Promise<KeyPair<Algorithm>>

Generates a post-quantum key pair. With no options it generates ML-KEM-768, ready for pqc.encrypt.

Parameters

options?

GenerateOptions<Algorithm>

Returns

Promise<KeyPair<Algorithm>>

Example

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

const encryption = await pqc.keys.generate();
const signing = await pqc.keys.generate({ algorithm: 'ml-dsa-65' });