diff --git a/README.md b/README.md index 3578b87..d62a2a9 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,12 @@ ========= Sponsored by [Root](https://therootcompany.com). -Built for [ACME.js](https://git.coolaj86.com/coolaj86/acme.js) -and [Greenlock.js](https://git.coolaj86.com/coolaj86/greenlock.js) +Built with [Eckles.js](https://git.coolaj86.com/coolaj86/eckles.js). ECDSA (elliptic curve) tools. +Designed for testing and debugging. + ## Install ```bash @@ -20,6 +21,7 @@ Table of Contents * [x] PEM to JWK * [x] JWK to PEM * [x] SSH "pub" format +* [x] Generate CSR (via [ECDSA-CSR.js](https://git.coolaj86.com/coolaj86/ecdsa-csr.js)) * [ ] RSA * **Need RSA tools?** Check out [Rasha.js](https://git.coolaj86.com/coolaj86/rasha.js) @@ -153,6 +155,21 @@ eckles id_rsa.pub > pub.jwk.json eckles privkey.jwk.json spki > pub.pem ``` +## Generate CSR + +``` +eckles csr [keyfile] [domains] +``` + +```bash +eckels csr privkey.pem example.com,www.example.com > csr.pem +``` + +```bash +eckels csr privkey.jwk.json example.com,www.example.com > csr.pem +``` + + Legal ----- diff --git a/bin/eckles.js b/bin/eckles.js index bce03e7..2ab52f0 100755 --- a/bin/eckles.js +++ b/bin/eckles.js @@ -54,11 +54,13 @@ try { if ('csr' === infile) { + // TODO this _should_ use JWK, + // but it doesn't yet + if ('string' !== typeof key) { + key = Eckles.exportSync({ jwk: key }); + } return ecdsacsr({ - // don't remember which it was... whatever - pem: key - , key: key - , jwk: key + key: key , domains: domains.split(/,/) }).then(function (csr) { console.info(csr); diff --git a/package.json b/package.json index f24f156..ad02d6a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "eckles-cli", - "version": "1.0.1", - "description": "Command line ECDSA tools to generating key pairs and converting between JWK, various PEM formats, and SSH", + "version": "1.1.0", + "description": "💯 Command line ECDSA tools to generating key pairs and converting between JWK, various PEM formats, and SSH", "homepage": "https://git.coolaj86.com/coolaj86/eckles-cli.js", "main": "bin/eckles.js", "bin": { diff --git a/test.sh b/test.sh index 3b9aa27..4c55ca4 100644 --- a/test.sh +++ b/test.sh @@ -41,6 +41,13 @@ node bin/eckles.js id_rsa public > /dev/null node bin/eckles.js id_rsa.pub > /dev/null echo "PASS" +echo "" +echo "Create CSR" +node bin/eckles.js csr ./privkey.2.sec1.pem example.com,example.net >/dev/null +node bin/eckles.js csr ./privkey.3.pkcs8.pem whatever.com,api.whatever.com,whatever.net >/dev/null +node bin/eckles.js csr ./privkey.1.jwk.json example.com,example.net >/dev/null +echo "PASS" + echo "" echo "" echo "Passed all tests"