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

Built distribution (wheel)

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

Total release size: 15.0 kB

Release files / cryptography_suite_azure_keyvault-4.0.0b2.tar.gz

Download URL cryptography_suite_azure_keyvault-4.0.0b2.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
342750e61eebfae670ca48a271fde4c40390c03682f2d1b5ea4b13487c6f7e5d
BLAKE2b-256 checksum
How to use checksums
12cbd1044de17c53b426e0a9e1fcecb0a27aa4840ea167663b70cde9b0bbc2b6
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_azure_keyvault-4.0.0b2-py3-none-any.whl

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