Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
function cryptoGenerateEncryptKey
import { cryptoGenerateEncryptKey } from "https://deno.land/x/simple_utility@v2.3.2/mod.full.ts";

Generate exportable public-key pair for ECDH. Curve algorithm is "NIST P-256". Key format is SPKI for public-key and PKCS8 for private-key.

Examples

Example 1

const key1 = await cryptoGenerateEncryptKey();
const key2 = await cryptoGenerateEncryptKey();

Returns

Promise<PubKey>