You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AJ ONeal
8bc9439f2b
|
5 年之前 | |
---|---|---|
README.md | 5 年之前 | |
index.html | 5 年之前 | |
package.json | 5 年之前 | |
ssh-to-jwk.js | 5 年之前 | |
ssh-to-jwk.min.js | 5 年之前 |
README.md
Bluecrypt SSH to JWK (for Browsers)
A minimal library to parse an SSH public key (id_rsa.pub
)
and convert it into a public JWK using Vanilla JS.
Works for RSA and ECDSA public keys.
Features
< 150 lines of code | 1.0kb gzipped | 2.4kb minified | 3.7kb with comments
- SSH Public Keys
- RSA Public Keys
- EC Public Keys
- P-256 (prime256v1, secp256r1)
- P-384 (secp384r1)
- node.js version
- on npm as bluecrypt-jwk-to-ssh
Need SSH Private Keys?
SSH private keys (id_rsa
) are just normal PEM files,
so you can use Eckles or Rasha, as mentioned above.
Web Demo
https://coolaj86.com/demos/ssh-to-jwk/
git clone https://git.coolaj86.com/coolaj86/bluecrypt-ssh-to-jwk.js
pushd bluecrypt-ssh-to-jwk.js/
open index.html
Install
You can use it as a plain-old javascript library:
<script src="https://git.coolaj86.com/coolaj86/bluecrypt-ssh-to-jwk.js/raw/branch/master/ssh-to-jwk.js"></script>
It's also on npm:
npm install bluecrypt-ssh-to-jwk
Usage
Very simple:
var pub = 'ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCE9Uli8bGnD4hOWdeo5KKQJ/P/vOazI4MgqJK54w37emP2JwOAOdMmXuwpxbKng3KZz27mz+nKWIlXJ3rzSGMo= root@localhost';
var ssh = SSH.parse(pub);
console.info(ssh.jwk);
Other Tools in the Bluecrypt Suite
- Bluecrypt JWK to SSH (RSA, EC, SSH)
- Bluecrypt ASN.1 decoder (x509, RSA, EC, etc)
- Bluecrypt ASN.1 builder (x509, RSA, EC, etc)
Legal
ssh-to-jwk.js | MPL-2.0 | Terms of Use | Privacy Policy
Bluecrypt™ is owned by AJ ONeal