denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.9k stars 5.22k forks source link

Node compat crypto prime256v1 named curve not found #21761

Closed HadaIonut closed 4 weeks ago

HadaIonut commented 8 months ago

Version: Deno 1.39.1

I am trying to get the node module werift working but i think i am having problems with the crypto symetric key generation. The module throws (TypeError) Unsupported named curve when trying to execute:

import { generateKeyPairSync } from "node:crypto";

generateKeyPairSync("ec", {
  namedCurve: "prime256v1",
  publicKeyEncoding: {
    format: "der",
    type: "spki",
  },
  privateKeyEncoding: {
    format: "der",
    type: "pkcs8",
  },
});

This seems to work fine in node.

iuioiua commented 5 months ago

I'll have a crack at this one.

iuioiua commented 5 months ago

Once #22882 is merged, this issue will be blocked on KeyObject.export() not being implemented.

lucacasonato commented 4 weeks ago

This is working in the latest canary.