feat: update readme

This commit is contained in:
2024-09-07 19:36:43 +08:00
parent a61782e3fe
commit 582ea8a9bb

View File

@@ -3,10 +3,15 @@
> FIDO(U2F, WebAuthn), YubiKey, OpenPGP command line tool > FIDO(U2F, WebAuthn), YubiKey, OpenPGP command line tool
Install: Install:
``` ```shell
cargo install --git https://git.hatter.ink/hatter/card-cli.git cargo install --git https://git.hatter.ink/hatter/card-cli.git
``` ```
Compile without features:
```shell
cargo build --release --no-default-features
```
# PGP # PGP
## encrypt & decrypt ## encrypt & decrypt
@@ -30,7 +35,7 @@ hW53WfImja+b5kwwyqUikyMCAwEAAQ==
``` ```
encrypt encrypt
``` ```shell
$ openssl rsautl -encrypt -pubin -inkey enc_key.pem -in test.txt -out enc.txt -pkcs $ openssl rsautl -encrypt -pubin -inkey enc_key.pem -in test.txt -out enc.txt -pkcs
OR OR
@@ -39,7 +44,7 @@ $ openssl pkeyutl -encrypt -inkey enc_key.pem -pubin -in a.txt -out enc.txt
``` ```
decrypt decrypt
``` ```shell
$ card-cli pgp-card-decrypt -c $(cat enc.txt | xxd -ps -c 11111) $ card-cli pgp-card-decrypt -c $(cat enc.txt | xxd -ps -c 11111)
OR OR
@@ -50,7 +55,7 @@ $ card-cli piv-decrypt -s r3 -c "$(cat enc.txt | base64)"
## sign & verify ## sign & verify
sign sign
``` ```shell
$ card-cli pgp-card-sign -2 $(shasum -a 256 test.txt | awk '{print $1}') $ card-cli pgp-card-sign -2 $(shasum -a 256 test.txt | awk '{print $1}')
OR OR
@@ -59,7 +64,7 @@ $ card-cli pgp-card-sign --in test.txt --use-sha256
``` ```
verify verify
``` ```shell
$ openssl dgst -sha256 -verify sign_key.pem -signature sig test.txt $ openssl dgst -sha256 -verify sign_key.pem -signature sig test.txt
Verified OK Verified OK
``` ```