Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

cryptography-suite-hashicorp-vault

HashiCorp Vault Transit provider for cryptography-suite, the policy-driven envelope encryption SDK. Pre-release; not independently audited.

Install

python -m pip install "cryptography-suite-hashicorp-vault[hvac]"

Use

import hvac

from cryptography_suite import EncryptionContext, KeyRef, Policy, Protector
from cryptography_suite_hashicorp_vault import PROVIDER_ID, VaultTransitProvider

client = hvac.Client(url="https://vault.internal:8200", token=vault_token, timeout=5)
protector = Protector(
    provider=VaultTransitProvider(client, mount_point="transit", health_key="payments"),
    policy=Policy.enterprise(approved_providers=[PROVIDER_ID]),
    primary_key=KeyRef(PROVIDER_ID, "payments"),
    audit_sink=audit_sink,
)
context = EncryptionContext({"tenant": "acme"}, purpose="payments")
envelope = protector.seal(b"...", context=context)
plaintext = protector.open(envelope, context=context)

You build the hvac.Client: address, authentication method, TLS, and namespace are yours. The provider never reads tokens or the environment and does not import hvac itself.

Keys and permissions

Item Value
Keys Transit keys of type aes256-gcm96, aes128-gcm96, or chacha20-poly1305, not derived and not convergent, named by key name.
Recorded version The key version. After vault write -f transit/keys/<name>/rotate, Protector.rewrap moves envelopes to the new latest version.
To seal read on transit/keys/<name>, update on transit/encrypt/<name>
To open update on transit/decrypt/<name>
Health check read on transit/keys/<health_key>
path "transit/keys/payments"    { capabilities = ["read"] }
path "transit/encrypt/payments" { capabilities = ["update"] }
path "transit/decrypt/payments" { capabilities = ["update"] }

Behaviour

  • Binding. Each wrap sends a digest of the envelope header as Transit associated_data, so Vault itself authenticates the binding. This needs a Vault release whose Transit API accepts associated_data.
  • Key states. Versions below the key's min_decryption_version are reported as disabled, so opening falls back to another recipient, such as an escrow key.
  • Key names. Names must follow Vault's own grammar for Transit keys. hvac does not escape / or .. in request paths, so any other name is refused before a request is built.
  • Timeouts. hvac sets its timeout per client (30 seconds by default), not per call, so the policy's provider_timeout_ms is checked between attempts but cannot cut a call short. Keep the client's timeout within it.
  • Errors. Vault errors map to stable error codes; rate limits, sealed or standby nodes, and transport failures are retryable within the policy's budget.

Documentation

cryptography_suite.providers.conformance.verify_provider checks the provider against a test key on your Vault.

Metadata

Release files for cryptography-suite-hashicorp-vault 4.0.0b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cryptography-suite-hashicorp-vault 4.0.0b2
File Size Uploaded Provenance Actions
cryptography_suite_hashicorp_vault-4.0.0b2.tar.gz 6.6 kB With provenance Details for cryptography_suite_hashicorp_vault-4.0.0b2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cryptography-suite-hashicorp-vault 4.0.0b2
File Interpreter ABI Platform Actions
cryptography_suite_hashicorp_vault-4.0.0b2-py3-none-any.whl Python 3 none any Details for cryptography_suite_hashicorp_vault-4.0.0b2-py3-none-any.whl

Total release size: 13.9 kB

Release files / cryptography_suite_hashicorp_vault-4.0.0b2.tar.gz

Download URL cryptography_suite_hashicorp_vault-4.0.0b2.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
da07b25d5563d6bfc834af4d7b3e1261890d5da8210745f41bc4abf73a3aeade
BLAKE2b-256 checksum
How to use checksums
45201a3e183ed65dfe752fec861fcbb047e6d2f06e6f0a1c4c5147880445eb15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / cryptography_suite_hashicorp_vault-4.0.0b2-py3-none-any.whl

Download URL cryptography_suite_hashicorp_vault-4.0.0b2-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89e841ea8726a7d353c77ccdcbacfd096c3775dbaf67a6ef282fa42e86cfc3b9
BLAKE2b-256 checksum
How to use checksums
955aa898a0c9787cb2dbd14c2662af19356b78716bb4e5f300184e89a1fdd457
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for cryptography-suite-hashicorp-vault 4.0.0b2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cryptography_suite_hashicorp_vault-4.0.0b2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page