Skip to main content
Pre-release

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

cryptography-suite-azure-keyvault

Azure Key Vault and Managed HSM provider for cryptography-suite, the policy-driven envelope encryption SDK. Pre-release; not independently audited.

Install

python -m pip install "cryptography-suite-azure-keyvault[azure]"

Use

from azure.identity import DefaultAzureCredential
from azure.keyvault.keys import KeyClient

from cryptography_suite import EncryptionContext, KeyRef, Policy, Protector
from cryptography_suite_azure_keyvault import PROVIDER_ID, AzureKeyVaultProvider

client = KeyClient(
    vault_url="https://acme-payments.vault.azure.net",
    credential=DefaultAzureCredential(),
)
protector = Protector(
    provider=AzureKeyVaultProvider(client),
    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 KeyClient: vault URL, credential, and transport are yours. The provider never reads credentials or the environment and does not import the Azure SDK itself.

Keys and permissions

Item Value
Keys RSA or RSA-HSM keys of 2048 bits or more with the wrapKey and unwrapKey operations, in Key Vault or Managed HSM, named by key name.
Recorded version The key version. After rotating, Protector.rewrap moves envelopes to the new version; old versions keep unwrapping what they wrapped.
To seal Key permissions get and wrapKey. With get, the Azure SDK wraps locally with the public key.
To open Key permission unwrapKey. The SDK also tries get first and continues without it when it is denied.
Health check Key permission list

The built-in role Key Vault Crypto User (or Managed HSM Crypto User) grants all of these; a custom role can split sealing from opening.

Behaviour

  • Binding. RSA-OAEP-256 has no associated data, so each wrap encrypts the data key together with SHA-256(label || protected header), and unwrap checks that digest in constant time: a wrapped key cannot be moved to another envelope. Key Vault's reported key identifier is checked against the recorded name and version.
  • Key states. Disabled, expired, and not-yet-valid versions are reported as disabled, so opening falls back to another recipient, such as an escrow key.
  • Timeouts. Every call turns the SDK's retry policy off (by default ten retries with backoff of up to two minutes) and carries connection and read timeouts of the time left before the operation's deadline, whatever retry policy the client was built with.
  • Errors. Key Vault errors map to stable error codes; throttling and transient service errors are retryable within the policy's budget.

Documentation

cryptography_suite.providers.conformance.verify_provider checks the provider against a test key in your vault.

Metadata

Release files for cryptography-suite-azure-keyvault 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-azure-keyvault 4.0.0rc1
File Size Uploaded Provenance Actions
cryptography_suite_azure_keyvault-4.0.0rc1.tar.gz 7.1 kB With provenance Details for cryptography_suite_azure_keyvault-4.0.0rc1.tar.gz

Built distribution (wheel)

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

Total release size: 15.0 kB

Release files / cryptography_suite_azure_keyvault-4.0.0rc1.tar.gz

Download URL cryptography_suite_azure_keyvault-4.0.0rc1.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
93319650c8ee7c9556d80a2763d346277d474dcf7187dea9a591e95afc010242
BLAKE2b-256 checksum
How to use checksums
96bf239bdd0e385775eb9ef08d4fc7555b02160be11cb1b35a6727efd28a1ac8
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_azure_keyvault-4.0.0rc1-py3-none-any.whl

Download URL cryptography_suite_azure_keyvault-4.0.0rc1-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e882042126e67b03ce2fe939827a4b0c900c5791cbfbe9fd8b7d0fafd5ded8f
BLAKE2b-256 checksum
How to use checksums
b369826bee09d2c5c667572a94049be5f9997815a5cf6d5560d24b3c39d16524
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-azure-keyvault 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_azure_keyvault-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