The AWS Cryptographic Material Providers Library for Python offers advanced key management functionalities, primarily focusing on KMS keyrings, for use with the AWS Encryption SDK. It simplifies the process of obtaining and managing cryptographic materials from sources like AWS KMS. The current version is 1.11.2, and it receives updates typically several times a year, often in conjunction with the AWS Encryption SDK or for KMS feature enhancements.
pip install aws-cryptographic-material-providersVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `KmsKeyring` and use it with the `EncryptionSDKClient` from the `aws-encryption-sdk` to encrypt and decrypt data. A valid AWS KMS Key ARN and appropriate AWS credentials are required for successful execution. If `KMS_KEY_ARN` is not set, it will only demonstrate the keyring instantiation.
Upgrade your Python environment to 3.11 or later. Check the `requires_python` field in PyPI for the latest requirements.
Always install `aws-cryptographic-material-providers` in a clean virtual environment or ensure `pip install -U aws-cryptographic-material-providers` to let pip resolve compatible dependencies. Avoid manually pinning `boto3` or `cryptography` to versions outside the library's specified ranges (`~=1.34.0` for boto3, `~=42.0.5` for cryptography in 1.11.2).
When initializing `KmsKeyring`, provide an explicit `boto3.client('kms', region_name='...')` instance. For example: `kms_client = boto3.client('kms'); keyring = KmsKeyring(generator_key_id=KMS_KEY_ARN, client=kms_client)`.