| 1 |
`jwt` command-line tool |
| 2 |
======================= |
| 3 |
|
| 4 |
This is a simple tool to sign, verify and show JSON Web Tokens from |
| 5 |
the command line. |
| 6 |
|
| 7 |
The following will create and sign a token, then verify it and output the original claims: |
| 8 |
|
| 9 |
echo {\"foo\":\"bar\"} | ./jwt -key ../../test/sample_key -alg RS256 -sign - | ./jwt -key ../../test/sample_key.pub -alg RS256 -verify - |
| 10 |
|
| 11 |
Key files should be in PEM format. Other formats are not supported by this tool. |
| 12 |
|
| 13 |
To simply display a token, use: |
| 14 |
|
| 15 |
echo $JWT | ./jwt -show - |
| 16 |
|
| 17 |
You can install this tool with the following command: |
| 18 |
|
| 19 |
go install github.com/golang-jwt/jwt/v4/cmd/jwt |