Kit
Functions

generateKeyPair

generateKeyPair(): Promise<CryptoKeyPair>

Generates an Ed25519 public/private key pair for use with other methods in this package that accept CryptoKey objects.

Returns

Promise<CryptoKeyPair>

Example

import { generateKeyPair } from '@solana/keys';
 
const { privateKey, publicKey } = await generateKeyPair();

On this page