diff --git a/README.md b/README.md index 32465c8..52618b3 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,20 @@ ECDSA tools. Lightweight. Zero Dependencies. Universal compatibility. * PEM-to-JWK ```js +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" + } + */ }); ``` diff --git a/bin/eckles.js b/bin/eckles.js index f3f7581..7b4f6d8 100755 --- a/bin/eckles.js +++ b/bin/eckles.js @@ -10,5 +10,5 @@ var infile = process.argv[2]; var keypem = fs.readFileSync(infile, 'ascii'); eckles.import({ pem: keypem }).then(function (jwk) { - console.log(jwk); + console.log(JSON.stringify(jwk, null, 2)); }); diff --git a/package.json b/package.json index 93ee963..4392650 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eckles", - "version": "0.1.0", + "version": "0.1.1", "description": "A focused, zero-dependency library for perfect universal ECDSA P-256 (prime256v1, secp256r1) and P-384 (secp384r1) support.", "main": "index.js", "bin": {