jwt
Go to file
2019-10-02 16:54:20 +08:00
.vscode update go.mod 2019-09-27 17:44:45 +08:00
cmd release v1.0.2 2019-10-02 16:54:20 +08:00
test 站点更新:2019-02-20 14:12:42 2019-02-20 14:12:42 +08:00
token update at 2019-09-19 16:56:49 by ehlxr 2019-09-19 16:56:49 +08:00
.gitignore add dep support 2018-03-27 16:46:46 +08:00
go.mod update go.mod 2019-09-27 17:51:49 +08:00
go.sum update go.mod 2019-09-27 17:51:49 +08:00
LICENSE 站点更新:2018-03-27 15:37:33 2018-03-27 15:37:33 +08:00
main.go update go.mod 2019-09-27 17:51:49 +08:00
Makefile release v1.0.2 2019-10-02 16:54:20 +08:00
README.md Update README.md 2018-04-03 10:40:49 +08:00
version release v1.0.2 2019-10-02 16:54:20 +08:00

JWT

This is a simple tool to sign, verify and show JSON Web Tokens (JWT) from the command line, base jwt-go.

jwt

Install

build with go get

➜ go get -u github.com/ehlxr/jwt

build with go dep

➜ git clone https://github.com/ehlxr/jwt.git

➜ cd jwt && dep ensure

or download releases binary package.

Usage

➜ jwt
JWT(Json Web Token) 工具
用于生成、验证、查看 JWT

Usage:
  jwt [command]

Available Commands:
  help        Help about any command
  show        查看 JWT Token
  sign        JWT 签名
  verify      JWT token 验证

Flags:
      --config string   config file (default is $HOME/.jwt.yaml)
  -h, --help            help for jwt
  -v, --version         show version of the jwt.

Use "jwt [command] --help" for more information about a command.

sign JWT

➜ jwt sign -h

签名 JWT token 并复制到剪切板
标记 * 号的 flag 为必须项

Usage:
  jwt sign [flags]

Flags:
  -c, --claims argList   add additional claims. may be used more than once (default {})
  -d, --data string      * path or json to claims object to sign, '-' to read from clipboard, or '+' to use only -claim args
  -H, --header argList   add additional header params. may be used more than once (default {})
  -h, --help             help for sign
  -k, --key string       * path of keyfile or key argument

Global Flags:
      --config string   config file (default is $HOME/.jwt.yaml)

show JWT

➜ jwt show -h

查看 JWT Token 内容
标记 * 号的 flag 为必须项

Usage:
  jwt show [flags]

Flags:
  -h, --help           help for show
  -t, --token string   * path or arg of JWT token to verify, '-' to read from clipboard

Global Flags:
      --config string   config file (default is $HOME/.jwt.yaml)

verify JWT

➜ jwt verify -h

验证 JWT token 是否有效
标记 * 号的 flag 为必须项

Usage:
  jwt verify [flags]

Flags:
  -h, --help           help for verify
  -k, --key string     * path of keyfile or key argument
  -t, --token string   * path or arg of JWT token to verify, '-' to read from clipboard

Global Flags:
      --config string   config file (default is $HOME/.jwt.yaml)