This repository has been archived on 2026-11-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
vault-plugin-secrets-gpg/docs/export.md
T
unkin-agent 53227f9126 Prepare for public release (#5)
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>
2026-11-17 23:12:37 +11:00

29 lines
913 B
Markdown

# Export
`GET /gpg/export/:type/:name(/:version)`
Returns armored key material. `public-key` can always be exported, and is what
`gpg` or `pass` imports to encrypt to the key. `private-key` works only if the
key is `exportable`.
| Parameter | Type | Description |
|-----------|------|-------------|
| `type` | string | `public-key` or `private-key`. |
| `name` | string | Name of the key. |
| `version` | int | Version to export. `0` means the latest version. Leave it out to export every version. |
The response has `name`, `type` and `keys`. `keys` maps each version number to
its armored key.
```sh
# all public versions
vault read gpg/export/public-key/app
# latest public key, ready for gpg
vault read -format=json gpg/export/public-key/app/0 \
| jq -r '.data.keys | to_entries[0].value' | gpg --import
# private key of version 1 (key must be exportable)
vault read gpg/export/private-key/app/1
```