10个版本
0.4.3 | 2023年10月21日 |
---|---|
0.4.2 | 2023年3月16日 |
0.4.1 | 2022年10月2日 |
0.3.0 | 2022年7月14日 |
0.1.5 | 2022年3月2日 |
#1693 in 密码学
45KB
919 行
jpki-cli
一个简单易用的CLI工具,用于访问您的JPKI卡。
✅ 环境需求
所有平台
- 支持PC/SC的NFC读卡器
在GNU/Linux上
- pcsc-lite (libpcsclite)
📦 安装
在macOS或Linux上,可以使用Homebrew Tap进行安装
brew tap siketyan/tap
brew install jpki-cli
或者,使用Cargo从源代码构建
cargo install jpki-cli
💚 示例
加密API
输出数字签名的证书
jpki-cli crypto read-certificate > certificate.der
如果您需要用户认证的证书,请添加--auth
jpki-cli crypto --auth read-certificate > certificate.der
使用密钥对从stdin签名数据
cat plain.txt | jpki-cli crypto sign > signature.sig
使用输出的证书验证签名
cat plain.txt | jpki-cli crypto verify certificate.der signature.sig
获取PIN状态
jpki-cli crypto stat
jpki-cli crypto --auth stat # Status of PIN for authentication
表面API
使用PIN B(出生日期YYMMDD
+ 有效期YYYY
+ CVCXXXX
)输出照片
jpki-cli surface get photo > photo.jpg
# PIN: YYMMDDYYYYXXXX
使用PIN A(我的号码)代替
jpki-cli surface get photo > photo.jpg
# PIN: XXXXYYYYZZZZ
有关可输出数据的列表,请参阅帮助信息
jpki-cli surface get --help
获取PIN状态
jpki-cli surface stat a # PIN Type A
jpki-cli surface stat b # PIN Type B
支持API
从卡中读取“我的号码”
jpki-cli support get my-number
以JSON格式读取卡中的文本属性
jpki-cli support get attributes --pretty
jpki-cli support get attributes | jq # The output is JSON, so you can query it w/ jq
获取PIN状态
jpki-cli support stat
依赖关系
~18–30MB
~529K SLoC