RFC-0024: HashiCorp Vault Transit Provider¶
Status: Proposed; adds a fourth distribution under the RFC-0016 rules.
Owner: Provider and security leads.
Last updated: 2026-11-29
Context¶
Many enterprises run HashiCorp Vault, on premises or across clouds, as their key service; its Transit secrets engine performs encryption without releasing keys. The roadmap listed a Vault provider next to the cloud KMS distributions.
Binding decision¶
cryptography-suite-hashicorp-vault follows every RFC-0016 rule: it imports
only cryptography_suite.errors and cryptography_suite.providers, never
imports hvac or reads tokens or the environment, and takes an
application-constructed hvac.Client (plus the Transit mount_point).
Identity.
key_idis the Transit key name;versionis the key version as canonical decimal text.describe_keyresolves the latest version and checks that a requested version exists.Keys.
aes128-gcm96,aes256-gcm96, andchacha20-poly1305keys that are neither derived nor convergent;supports_encryptionandsupports_decryptiongive the wrap and unwrap capabilities. Other keys have none.Binding. Each wrap calls
encryptwithkey_versionset to the recorded version andassociated_data = base64("cryptography-suite/v4 binding" || 0x00 || SHA-256(binding)), so Vault’s AEAD authenticates the envelope header. Unwrap sends the same associated data todecrypt.Version pinning. The returned ciphertext must start with
vault:v<version>:(otherwiseKEY_VERSION_STALE); on unwrap, the stored ciphertext must name the recorded version (otherwiseAUTHENTICATION_FAILED), so a wrapped key cannot claim a different version than the envelope records. The wrapping algorithm identifier isvault-transit-aead-bound.State. A version below
min_decryption_versionisDISABLED, so the protector falls back to another recipient (RFC-0011).Errors. hvac exceptions are matched by class name along their hierarchy:
InvalidPathKEY_NOT_FOUND;ForbiddenandUnauthorizedPROVIDER_AUTH_FAILED;RateLimitExceededPROVIDER_RATE_LIMITED;InternalServerError,BadGateway,VaultDown,PreconditionFailed, and transport failures retryable;InvalidRequestisAUTHENTICATION_FAILEDon decrypt andCAPABILITY_UNSUPPORTEDotherwise. Vault messages are never kept.
Test and validation requirements¶
tests/provider_packages/test_hashicorp_vault.py runs the provider against
an in-memory Transit engine that performs real AES-256-GCM with the
associated data, and covers the round trip, the conformance kit for all
three key types, rotation and rewrap, min_decryption_version with escrow
fallback, capabilities and states, binding and tampering, version pinning,
untrustworthy responses, every error mapping, retries, health, and
construction. One test drives the provider through the real hvac client
over an in-process HTTP transport (hvac pinned in requirements-dev.txt),
checking the JSON hvac sends and hvac’s own exception mapping.
Writing that fake exposed two test-side mistakes, both caught by the
conformance kit or the tests: an unparsable ciphertext must be a 400 from
Vault (not a client-side exception), and a length check in the provider was
unreachable because WrappedKey already bounds the size, so it was removed.
Live tests against a real Vault server remain release work, as for the cloud providers.