Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does forge support ec256 keys? #1093

Open
sbweeden opened this issue Aug 13, 2024 · 1 comment
Open

Does forge support ec256 keys? #1093

sbweeden opened this issue Aug 13, 2024 · 1 comment

Comments

@sbweeden
Copy link

More of a question than an issue I guess - but tried this:

PEM file of EC256 key:

-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIFB2teeHGu5T7bh597NtvJJJ/WumONRAkfOzYCP1nKEFoAoGCCqGSM49
AwEHoUQDQgAEaYys5soGb5m0vg1sgNRTw+/2WthcZO3FI1ALhu62jszNvcyipL7s
/4Vx/bP11KhwnwhX9ucDyq+HtV1dmgXmig==
-----END EC PRIVATE KEY-----

JS code:

let pkiPrivateKey = pki.privateKeyFromPem( <string of PEM above> );

Got error:

Error: Cannot read public key. Unknown OID.
    at pki.publicKeyFromAsn1 (.../node_modules/node-forge/lib/rsa.js:1474:19)
    at pki.publicKeyFromPem(.../node_modules/node-forge/lib/x509.js:865:14)
...

Looks like it assumes RSA keys. No support at all for EC256?

@El-Virus
Copy link

El-Virus commented Aug 14, 2024

Do take a look at: #925

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants