v1.2.0: lots of fun with keypairs

This commit is contained in:
AJ ONeal 2019-03-05 07:28:44 -07:00
parent a5f2365761
commit f8dc3894e3
3 changed files with 24 additions and 3 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules
.*.sw*

View File

@ -36,6 +36,7 @@ so you should only script to the documented syntax. ;)
* Convert: `keypairs ./priv.pem`
* Sign: `keypairs ./priv.pem sign https://example.com/ '{"sub":"jon@example.com"}'`
* Verify: `keypairs verify 'xxxxx.yyyyy.zzzzz'`
* Decode: `keypairs decode 'xxxxx.yyyyy.zzzzz'`
## Generate a New Key
@ -130,8 +131,22 @@ keypairs priv.json priv.pem
<!-- or Payload (JWS) -->
**Syntax**:
```bash
keypairs ./priv.pem sign https://example.com/ '{"sub":"jon@example.com"}' 1h
keypairs [key] sign [issuer url] <claims> [exp] [nbf]
```
_Note: The issuer url can be omitted if it's already included among the claims._
Example:
```bash
keypairs ./priv.pem sign https://example.com/ '{"sub":"jon@example.com"}' 1h -5m
```
```bash
keypairs '{"kty":"EC",...}' sign https://example.com/ '{"sub":"jon@example.com"}' 1h -5m
```
## Verify a JWT (Token)

View File

@ -4,7 +4,10 @@
"description": "CLI for Keypairs.js",
"homepage": "https://git.coolaj86.com/coolaj86/keypairs-cli.js",
"main": "bin/keypairs-cli.js",
"files": [ "CLI.md", "bin/keypairs.js" ],
"files": [
"CLI.md",
"bin/keypairs.js"
],
"scripts": {
"test": "node test.js"
},
@ -28,6 +31,7 @@
"author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)",
"license": "MPL-2.0",
"dependencies": {
"keypairs": "1.x",
"keyfetch": "1.x",
"keypairs": "1.x"
}
}