webcrypto
webcrypto copied to clipboard
Export key error
With the latest release of this library v1.1.7 I get the following error
Cannot get schema for 'PrivateKeyInfo' target
When running the following
const crypto = new Crypto();
const cryptoKeyPair = (await crypto.subtle.generateKey(
{
name: "ECDSA",
namedCurve: "P-256",
},
true,
[KeyUsage.SIGN]
));
const exportedKey = (await subtleCrypto.exportKey("jwk", cryptoKeyPair.privateKey));
Issue is not present with v1.1.6
For additional context i'm running NodeJS 12.22.1
Looks like you've got a few versions of @peculiar/asn1-schema
in your project. Call npm list @peculiar/asn1-schema
to check it out. And npm dedupe
to fix it