💯 ECDSA tools. Key Generation. PEM-to-JWK. JWK-to-PEM. Lightweight. Zero Dependencies. Universal compatibility.
Go to file
AJ ONeal 882cc4b859 v0.7.1: update docs for JWK-to-PEM 2018-11-19 22:20:44 -07:00
bin v0.7.0: add sec1 output 2018-11-19 22:12:27 -07:00
fixtures v0.7.0: add sec1 output 2018-11-19 22:12:27 -07:00
lib v0.7.0: add sec1 output 2018-11-19 22:12:27 -07:00
.gitignore v0.1.0: Full PEM-to-JWK support 2018-11-18 22:50:08 -07:00
README.md v0.7.1: update docs for JWK-to-PEM 2018-11-19 22:20:44 -07:00
index.js v0.1.0: Full PEM-to-JWK support 2018-11-18 22:50:08 -07:00
package.json v0.7.1: update docs for JWK-to-PEM 2018-11-19 22:20:44 -07:00
test.sh v0.7.0: add sec1 output 2018-11-19 22:12:27 -07:00

README.md

eckles.js

ECDSA tools. Lightweight. Zero Dependencies. Universal compatibility.

I just cleaned up the PEM-to-JWK functionality enough to publish. I also have the JWK-to-PEM functionality mostly built, but not enough to publish.

  • P-256 (prime256v1, secp256r1)
  • P-384 (secp384r1)
  • SPKI/PKIX
  • PKCS#8
  • SEC1/X9.62
  • PEM-to-JWK
  • JWK-to-PEM
var eckles = require('eckles');
var pem = require('fs').readFileSync('./fixtures/privkey-ec-p256.sec1.pem', 'ascii')

eckles.import({ pem: pem }).then(function (jwk) {
  console.log(jwk);
  /*
  {
    "kty": "EC",
    "crv": "P-256",
    "d": "iYydo27aNGO9DBUWeGEPD8oNi1LZDqfxPmQlieLBjVQ",
    "x": "IT1SWLxsacPiE5Z16jkopAn8_-85rMjgyCokrnjDft4",
    "y": "mP2JwOAOdMmXuwpxbKng3KZz27mz-nKWIlXJ3rzSGMo"
  }
  */
});
eckles.export({ jwk: jwk }).then(function (pem) {
  // PEM in pkcs#8 format
  console.log(pem);
});

Goals

  • Zero Dependencies
  • Focused support for P-256 and P-384, which are already universally supported.
  • Convert both ways
  • Browser support as well