Browse Source

v1.2.2: handle padding of private key

master v1.2.2
AJ ONeal 5 years ago
parent
commit
b5c919b557
  1. 4
      lib/ssh-parser.js
  2. 2
      package.json

4
lib/ssh-parser.js

@ -197,7 +197,9 @@ SSH.parsePublicKey = function (ssh) {
while (0x00 === y[0]) { y = y.slice(1); }
if (els[3]) {
ssh.jwk.d = Enc.bufToUrlBase64(els[3]);
d = els[3];
while (0x00 === d[0]) { d = d.slice(1); }
ssh.jwk.d = Enc.bufToUrlBase64(d);
}
ssh.jwk.x = Enc.bufToUrlBase64(x);
ssh.jwk.y = Enc.bufToUrlBase64(y);

2
package.json

@ -1,6 +1,6 @@
{
"name": "ssh-to-jwk",
"version": "1.2.1",
"version": "1.2.2",
"description": "💯 SSH to JWK in a lightweight, zero-dependency library.",
"homepage": "https://git.coolaj86.com/coolaj86/ssh-to-jwk.js",
"main": "index.js",

Loading…
Cancel
Save