Skip to main content
Pre-release

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

cryptography-suite-gcp-kms

Google Cloud KMS provider for cryptography-suite, the policy-driven envelope encryption SDK, including post-quantum ML-KEM and X-Wing keys. Pre-release; not independently audited.

Install

python -m pip install "cryptography-suite-gcp-kms[google]"

Use

from google.cloud import kms

from cryptography_suite import EncryptionContext, KeyRef, Policy, Protector
from cryptography_suite_gcp_kms import PROVIDER_ID, GcpKmsProvider

key = "projects/acme/locations/europe-west4/keyRings/data/cryptoKeys/payments"
protector = Protector(
    provider=GcpKmsProvider(kms.KeyManagementServiceClient(), health_key=key),
    policy=Policy.enterprise(approved_providers=[PROVIDER_ID]),
    primary_key=KeyRef(PROVIDER_ID, key),
    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 client: project, credentials, and transport are yours. The provider never reads credentials or the environment and does not import the Google libraries itself.

Keys and permissions

Item Value
Keys ENCRYPT_DECRYPT CryptoKeys (GOOGLE_SYMMETRIC_ENCRYPTION), named by CryptoKey resource name. Post-quantum: KEY_ENCAPSULATION CryptoKeys with ML_KEM_768, ML_KEM_1024, or KEM_XWING, named with an explicit CryptoKeyVersion.
Recorded version The CryptoKeyVersion resource name. After rotating, Protector.rewrap moves envelopes to the new primary version without touching their records.
To seal roles/cloudkms.cryptoKeyEncrypter and roles/cloudkms.viewer; for KEM keys, roles/cloudkms.publicKeyViewer and roles/cloudkms.viewer
To open roles/cloudkms.cryptoKeyDecrypter; for KEM keys, roles/cloudkms.decapsulator
Health check cloudkms.cryptoKeys.get on health_key

Behaviour

  • Binding. Symmetric wraps call Encrypt on the exact version with the additional authenticated data "cryptography-suite/v4 binding" || 0x00 || SHA-256(protected header). Every request and response is checked end to end with CRC32C.
  • Post-quantum keys. KEM wraps are standard RFC 9180 HPKE ciphertexts. Encapsulation runs locally on the version's public key (fetched once, checked, and cached) and needs ML-KEM in pyca/cryptography; unwrapping calls Decapsulate, so the private key never leaves Cloud KMS and the reader needs no ML-KEM support.
  • Timeouts. Every call passes retry=None and a timeout of the time left before the operation's deadline, so the library's own retries (up to 60 seconds per call by default, and none at all for Decapsulate) never apply and provider_timeout_ms holds.
  • Errors. Cloud KMS errors map to stable error codes; quota 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 project.

Metadata

Release files for cryptography-suite-gcp-kms 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-gcp-kms 4.0.0b2
File Size Uploaded Provenance Actions
cryptography_suite_gcp_kms-4.0.0b2.tar.gz 9.3 kB With provenance Details for cryptography_suite_gcp_kms-4.0.0b2.tar.gz

Built distribution (wheel)

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

Total release size: 19.5 kB

Release files / cryptography_suite_gcp_kms-4.0.0b2.tar.gz

Download URL cryptography_suite_gcp_kms-4.0.0b2.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
71d253c69cd8fa8c9a2f6f3f1b0e37cd85acf8a8f718d2eee419a276b4fc59c4
BLAKE2b-256 checksum
How to use checksums
958e1635f82f5b7c7c446beadfdc21991c2dc8c750553997a05af8547475eaed
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_gcp_kms-4.0.0b2-py3-none-any.whl

Download URL cryptography_suite_gcp_kms-4.0.0b2-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba4dfa571ac1301fb090075cc0679b6624d71199506e7444b8d246f11302a168
BLAKE2b-256 checksum
How to use checksums
c33198ef885891e239a277e4e4ef06718046b52d01e913379d74c0d64b47fae2
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-gcp-kms 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_gcp_kms-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