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
Encrypton 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=Noneand 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 forDecapsulate) never apply andprovider_timeout_msholds. - 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.0rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cryptography_suite_gcp_kms-4.0.0rc1.tar.gz | 9.3 kB | With provenance | Details for cryptography_suite_gcp_kms-4.0.0rc1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cryptography_suite_gcp_kms-4.0.0rc1-py3-none-any.whl | Python 3 | none | any | Details for cryptography_suite_gcp_kms-4.0.0rc1-py3-none-any.whl |
Total release size: 19.5 kB
Release files / cryptography_suite_gcp_kms-4.0.0rc1.tar.gz
| Download URL | cryptography_suite_gcp_kms-4.0.0rc1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc3e9126f86306e8d455b9a48c532501d3ababea2b83b2fc56d1c9cb902fe173
|
|
BLAKE2b-256 checksum How to use checksums |
1f75f07610a448749727610490f983e51dbb453675a8b91e8654f1ce3eb2d643
|
| 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 logRelease files / cryptography_suite_gcp_kms-4.0.0rc1-py3-none-any.whl
| Download URL | cryptography_suite_gcp_kms-4.0.0rc1-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d1fae4d11efb7d4116814b6a8d1f1b3f3cd6f084537171469c3939eb62ff824
|
|
BLAKE2b-256 checksum How to use checksums |
9a8bdee46ea583f9d23d12a8f8256f364d073d815c343679467b5afa1bd9cd08
|
| 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 logSecurity for cryptography-suite-gcp-kms 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.
Attestation for cryptography_suite_gcp_kms-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 logA 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.