Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8bc9439f2b | |||
| 6bd98c7518 | |||
| 72158cb60f | |||
| 19274dfe1b |
@ -27,6 +27,8 @@ so you can use Eckles or Rasha, as mentioned above.
|
|||||||
|
|
||||||
<https://coolaj86.com/demos/ssh-to-jwk/>
|
<https://coolaj86.com/demos/ssh-to-jwk/>
|
||||||
|
|
||||||
|
<img border="1" src="https://i.imgur.com/g35NuLP.png" />
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://git.coolaj86.com/coolaj86/bluecrypt-ssh-to-jwk.js
|
git clone https://git.coolaj86.com/coolaj86/bluecrypt-ssh-to-jwk.js
|
||||||
pushd bluecrypt-ssh-to-jwk.js/
|
pushd bluecrypt-ssh-to-jwk.js/
|
||||||
|
|||||||
@ -19,7 +19,8 @@
|
|||||||
<pre><code class="js-jwk"> </code></pre>
|
<pre><code class="js-jwk"> </code></pre>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<p>Made with <a href="https://git.coolaj86.com/coolaj86/bluecrypt-ssh-to-jwk.js/">ssh-to-jwk.js</a></p>
|
<p>Made with <a href="https://git.coolaj86.com/coolaj86/bluecrypt-ssh-to-jwk.js/">ssh-to-jwk.js</a> (Browser friendly)</p>
|
||||||
|
<p>Also available for node.js: <a href="https://git.coolaj86.com/coolaj86/ssh-to-jwk.js/">ssh-to-jwk.js</a></p>
|
||||||
|
|
||||||
<script src="./ssh-to-jwk.js"></script>
|
<script src="./ssh-to-jwk.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bluecrypt-ssh-to-jwk",
|
"name": "bluecrypt-ssh-to-jwk",
|
||||||
"version": "1.0.1",
|
"version": "1.0.3",
|
||||||
"description": "SSH to JWK in < 150 lines of VanillaJS.",
|
"description": "SSH to JWK in < 150 lines of VanillaJS.",
|
||||||
"homepage": "https://git.coolaj86.com/coolaj86/bluecrypt-ssh-to-jwk.js",
|
"homepage": "https://git.coolaj86.com/coolaj86/bluecrypt-ssh-to-jwk.js",
|
||||||
"main": "ssh-to-jwk.js",
|
"main": "ssh-to-jwk.js",
|
||||||
|
|||||||
@ -94,8 +94,8 @@ SSH.parsePublicKey = function (ssh) {
|
|||||||
var y = els[2].slice(1 + len, 1 + len + len);
|
var y = els[2].slice(1 + len, 1 + len + len);
|
||||||
|
|
||||||
// I don't think EC keys use 0x00 padding, but just in case
|
// I don't think EC keys use 0x00 padding, but just in case
|
||||||
if (0x00 === x[0]) { x = x.slice(1); }
|
while (0x00 === x[0]) { x = x.slice(1); }
|
||||||
if (0x00 === y[0]) { y = y.slice(1); }
|
while (0x00 === y[0]) { y = y.slice(1); }
|
||||||
|
|
||||||
ssh.jwk.x = Enc.bufToUrlBase64(x);
|
ssh.jwk.x = Enc.bufToUrlBase64(x);
|
||||||
ssh.jwk.y = Enc.bufToUrlBase64(y);
|
ssh.jwk.y = Enc.bufToUrlBase64(y);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user