add bash git/pgp/plaintext example
This commit is contained in:
parent
db54a28ae9
commit
4f7b703cbb
17
README.md
17
README.md
|
@ -66,6 +66,23 @@ they appear in all capitals, as shown here.
|
||||||
- sig_type: (required) signature type (webauthn, pgp, etc)
|
- sig_type: (required) signature type (webauthn, pgp, etc)
|
||||||
- signature: (required) actual ascii armored signature payload
|
- signature: (required) actual ascii armored signature payload
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
### Bash: Git and pgp with plaintext review
|
||||||
|
```
|
||||||
|
local -r review_body="LGTM"
|
||||||
|
local -r review_hash="$(printf $review_body | openssl sha256 | awk '{print $2}')"
|
||||||
|
local -r vcs_ref="$(git rev-parse HEAD)"
|
||||||
|
local -r tree_hash="$(git rev-parse 'HEAD^{tree}')"
|
||||||
|
local -r sig_body="sig:v0:$vcs_ref:$tree_hash:$review_hash:pgp"
|
||||||
|
local -r sig=$(\
|
||||||
|
printf "%s" "$body" \
|
||||||
|
| gpg --detach-sign \
|
||||||
|
| openssl base64 -A \
|
||||||
|
)
|
||||||
|
printf "%s" "$sig_body:$review_body:$sig"
|
||||||
|
```
|
||||||
|
|
||||||
## Background
|
## Background
|
||||||
|
|
||||||
TODO
|
TODO
|
||||||
|
|
Loading…
Reference in New Issue