Skip to main content

Module secret

Module secret 

Source
Expand description

Secret storage backends for shine env secret encrypt/decrypt.

Two backends exist: GPG (the original, still the default) and age, added for multi-recipient encryption with Apple Touch ID support via age-plugin-se Secure Enclave identities. Ciphertext carries a backend tag (age:<base64>); untagged base64 continues to route to GPG so secrets encrypted before age existed keep decrypting unmodified.

Encryption always needs a resolved recipient list (EncryptRecipients); decryption is purely tag-based and never consults secret_backend, so changing the default encrypt backend can never break existing secrets.

Enums§

BackendKind
Which external tool a piece of ciphertext (or an encrypt request) belongs to.
EncryptRecipients
A resolved recipient list for encryption, tagged by backend.

Functions§

decrypt_secret
Decrypt stored ciphertext, routing purely on its tag. age_identities is only consulted when the ciphertext is tagged age:.
encrypt_secret
Encrypt plaintext for the given recipients, returning storage-ready ciphertext (tagged for age, untagged for GPG).
parse_tagged_ciphertext
Split stored ciphertext into its backend and undecorated payload. Untagged ciphertext is treated as GPG for backward compatibility with secrets encrypted before the age backend existed.