v1.2.0: lots of fun with keypairs
This commit is contained in:
parent
a5f2365761
commit
f8dc3894e3
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
.*.sw*
|
17
README.md
17
README.md
@ -36,6 +36,7 @@ so you should only script to the documented syntax. ;)
|
|||||||
* Convert: `keypairs ./priv.pem`
|
* Convert: `keypairs ./priv.pem`
|
||||||
* Sign: `keypairs ./priv.pem sign https://example.com/ '{"sub":"jon@example.com"}'`
|
* Sign: `keypairs ./priv.pem sign https://example.com/ '{"sub":"jon@example.com"}'`
|
||||||
* Verify: `keypairs verify 'xxxxx.yyyyy.zzzzz'`
|
* Verify: `keypairs verify 'xxxxx.yyyyy.zzzzz'`
|
||||||
|
* Decode: `keypairs decode 'xxxxx.yyyyy.zzzzz'`
|
||||||
|
|
||||||
## Generate a New Key
|
## Generate a New Key
|
||||||
|
|
||||||
@ -130,8 +131,22 @@ keypairs priv.json priv.pem
|
|||||||
|
|
||||||
<!-- or Payload (JWS) -->
|
<!-- or Payload (JWS) -->
|
||||||
|
|
||||||
|
**Syntax**:
|
||||||
|
|
||||||
```bash
|
```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)
|
## Verify a JWT (Token)
|
||||||
|
@ -4,7 +4,10 @@
|
|||||||
"description": "CLI for Keypairs.js",
|
"description": "CLI for Keypairs.js",
|
||||||
"homepage": "https://git.coolaj86.com/coolaj86/keypairs-cli.js",
|
"homepage": "https://git.coolaj86.com/coolaj86/keypairs-cli.js",
|
||||||
"main": "bin/keypairs-cli.js",
|
"main": "bin/keypairs-cli.js",
|
||||||
"files": [ "CLI.md", "bin/keypairs.js" ],
|
"files": [
|
||||||
|
"CLI.md",
|
||||||
|
"bin/keypairs.js"
|
||||||
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node test.js"
|
"test": "node test.js"
|
||||||
},
|
},
|
||||||
@ -28,6 +31,7 @@
|
|||||||
"author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)",
|
"author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"keypairs": "1.x",
|
"keyfetch": "1.x",
|
||||||
|
"keypairs": "1.x"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user