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>
1.3 KiB
1.3 KiB
Encrypt and decrypt
Messages are standard OpenPGP messages. Anything encrypted to the key's public
key, whether by this engine, gpg or pass, can be decrypted here.
Encrypt
POST /gpg/encrypt/:name
Encrypts to the latest key version.
| Parameter | Type | Default | Description |
|---|---|---|---|
plaintext |
string | required | Base64-encoded plaintext. |
format |
string | base64 |
base64 (base64-encoded binary OpenPGP), or ascii-armor. |
The response has ciphertext and key_version.
vault write -field=ciphertext gpg/encrypt/app plaintext=$(base64 <<<"secret")
vault write -field=ciphertext gpg/encrypt/app plaintext=$(base64 <<<"secret") format=ascii-armor
Decrypt
POST /gpg/decrypt/:name
Tries every key version at or above min_decryption_version. The engine
detects whether the input is armored or binary.
| Parameter | Type | Description |
|---|---|---|
ciphertext |
string | ASCII-armored message, or base64-encoded binary (the format gpg/pass write by default). |
The response has plaintext (base64).
vault write -field=plaintext gpg/decrypt/app ciphertext="$ct" | base64 -d
# decrypt a file written by gpg or pass
vault write -field=plaintext gpg/decrypt/app \
ciphertext=$(base64 -w0 ~/.password-store/email/example.gpg) | base64 -d