# RFC-0016: Cloud Provider Distributions and the Conformance Kit - **Status:** Proposed; implements the RFC-0006 provider table rows for AWS KMS and Google Cloud KMS, and the conformance requirement of decision D-003. - **Owner:** Provider leads; security review required before any support tier. - **Last updated:** 2026-11-29 ## Context RFC-0006 and decisions D-009/D-013 require provider integrations to ship as separately versioned distributions, constructed explicitly, with their SDK dependencies kept out of the core (dependency rule 16), and to pass conformance tests before claiming a support tier. ## Decisions ### Distributions | Distribution | Module | Provider id | Version recorded in envelopes | | --- | --- | --- | --- | | `cryptography-suite-aws-kms` | `cryptography_suite_aws_kms` | `com.amazonaws.kms` | Key ARN (aliases resolved first) | | `cryptography-suite-gcp-kms` | `cryptography_suite_gcp_kms` | `com.google.cloud.kms` | CryptoKeyVersion resource name | Both live under `packages/` in this repository, pin `cryptography-suite==4.0.0.dev0`, ship `py.typed`, and expose no entry points. They import only `cryptography_suite.errors` and `cryptography_suite.providers`, and read no environment; a contract test checks all of this. ### Bring your own client Each provider takes an SDK client the application has already built (region, credentials, endpoints, transport). The distributions do not import the SDKs, which are offered as optional extras (`[boto3]`, `[google]`), so credentials stay with the SDK's own credential chain and the provider code has no dependency to audit beyond the core. SDK retries should be disabled (one attempt) so that only the policy's bounded retry budget applies. ### Binding - AWS: `Encrypt`/`Decrypt` with `SYMMETRIC_DEFAULT` and encryption context `{"cryptography-suite:binding": base64url(SHA-256(protected header))}`. Decrypt is pinned to the recorded key ARN. The context appears in CloudTrail, linking each key use to an envelope without revealing it. - GCP: `Encrypt` on the exact CryptoKeyVersion, with additional authenticated data `"cryptography-suite/v4 binding" || 0x00 || SHA-256(protected header)`. Every request and response carries CRC32C checksums; a mismatch is a retryable `PROVIDER_UNAVAILABLE`. ### Errors SDK failures are mapped by service error code (AWS) or exception class name (GCP) to the stable taxonomy: not found, key state (`KEY_STATE_DENIED`), authentication and permission, authentication failure of the wrapped key, unsupported capability, and retryable rate limits, timeouts, and outages. Unknown failures are permanent `PROVIDER_UNAVAILABLE`. SDK messages, which can contain account numbers and resource names, are never kept or chained. ### Conformance kit `cryptography_suite.providers.conformance.verify_provider(provider, key)` runs nine checks every provider must pass: immutable enabled version with both capabilities, wrapped key naming that version, data key not visible, correct unwrap, binding enforced, tampering rejected as an authentication failure, randomized wrapping, `KEY_NOT_FOUND` for an unknown key, and a health report naming the provider. The HPKE provider, the test provider, and both cloud providers pass it in CI; third-party providers can run it against a real test key in their own integration environment. ## Security consequences - Cloud providers are not yet tested against live services; their behaviour is verified against faithful in-memory models of the documented APIs. No support tier is claimed until live integration tests run (RFC-0006). - `bytes(view)` copies the data key into an immutable buffer for the SDK call; Python cannot wipe it (specification section 11). ## Deferred Azure Key Vault and Managed HSM, HashiCorp Vault Transit, PKCS #11, live integration jobs with short-lived credentials, and provider release automation.