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.0rc1

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.0rc1
File Size Uploaded Provenance Actions
cryptography_suite_hashicorp_vault-4.0.0rc1.tar.gz 6.6 kB With provenance Details for cryptography_suite_hashicorp_vault-4.0.0rc1.tar.gz

Built distribution (wheel)

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

Total release size: 13.9 kB

Release files / cryptography_suite_hashicorp_vault-4.0.0rc1.tar.gz

Download URL cryptography_suite_hashicorp_vault-4.0.0rc1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f8f5d05ef334aa54a9014de53c08f94dd93e6948f7b5fd989243f4f3fb06b870
BLAKE2b-256 checksum
How to use checksums
0b805a36c7a5fdb3190eab61d6850aa3a4bd05b4ac7b460d73b20b87d546ee17
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 Dec 1, 2026.

Transparency log

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

Download URL cryptography_suite_hashicorp_vault-4.0.0rc1-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3418061f3470ecfdc5d760237bcc3f7d4a0d4816b013dd4076c5f0a01bf84952
BLAKE2b-256 checksum
How to use checksums
9cd339fa9bc0bcbbaa614babd92e108b75f93096c74f8ac934028771af1da79b
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 Dec 1, 2026.

Transparency log

Security for cryptography-suite-hashicorp-vault 4.0.0rc1

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.0rc1.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 Dec 1, 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