What is the easiest way to convert a PKCS8 formatted EC Key string into a JWK using ECSDA?

88 Views Asked by At

I don't care if it is the OpenSSL, Python or other ways.

The reason why I want to convert from PKCS8 string (with Elliptic Curve key) to JSON Web Key (JWK), so I can see the claims like kid, etc

I've tried using the eckles library.

var Eckles = require('eckles');
var pem = require('fs')
  .readFileSync('./node_modles/eckles/fixtures/privkey-ec-p256.sec1.pem', 'ascii');

Eckles.import({ pem: pem }).then(function (jwk) {
  console.log(jwk);
});

but the output only returns the kty, crv, d, x, y .. but not the kid claims.

0

There are 0 best solutions below