53227f9126
The engine is being published as github.com/IUCLabs/vault-plugin-secrets-gpg, so the module path, docs and examples must stand alone without private infrastructure references. - move the Go module to github.com/IUCLabs/vault-plugin-secrets-gpg - replace private identities in examples and tests with example.com - add MIT LICENSE - rewrite README: overview, install for Vault and OpenBao, usage, link to terraform-provider-vault-secrets-gpg - add per-path reference docs under docs/ - correct min_decryption_version description (decryption only) Reviewed-on: #5 Co-authored-by: unkin-agent <unkin-agent@unkin.net> Co-committed-by: unkin-agent <unkin-agent@unkin.net>
44 lines
1.3 KiB
Markdown
44 lines
1.3 KiB
Markdown
# Sign and verify
|
|
|
|
These paths create and check detached OpenPGP signatures. The input message is
|
|
always base64-encoded.
|
|
|
|
## Sign
|
|
|
|
`POST /gpg/sign/:name`
|
|
|
|
| Parameter | Type | Default | Description |
|
|
|-----------|------|---------|-------------|
|
|
| `input` | string | required | Base64-encoded message to sign. |
|
|
| `key_version` | int | `0` (latest) | Key version to sign with. |
|
|
| `format` | string | `ascii-armor` | `ascii-armor`, or `base64` for a raw binary signature. |
|
|
|
|
The response has `signature`.
|
|
|
|
```sh
|
|
vault write -field=signature gpg/sign/app input=$(base64 -w0 release.tar.gz) > release.tar.gz.asc
|
|
|
|
# check it with gpg, using the exported public key
|
|
vault read -field=public_key gpg/keys/app | gpg --import
|
|
gpg --verify release.tar.gz.asc release.tar.gz
|
|
```
|
|
|
|
## Verify
|
|
|
|
`POST /gpg/verify/:name`
|
|
|
|
Checks the signature against every key version.
|
|
|
|
| Parameter | Type | Description |
|
|
|-----------|------|-------------|
|
|
| `input` | string | Base64-encoded message that was signed. |
|
|
| `signature` | string | Detached signature, either ASCII-armored or base64-encoded binary. |
|
|
|
|
The response has `valid` (`true` or `false`). A malformed signature returns
|
|
`valid=false`, not an error.
|
|
|
|
```sh
|
|
vault write -field=valid gpg/verify/app \
|
|
input=$(base64 -w0 release.tar.gz) signature=@release.tar.gz.asc
|
|
```
|