Most Recent Provider

Cryptographic materials provider that uses a provider store to obtain cryptographic materials.

class dynamodb_encryption_sdk.material_providers.most_recent.CachingMostRecentProvider(provider_store, material_name, version_ttl, cache_size=1000)[source]

Bases: dynamodb_encryption_sdk.material_providers.CryptographicMaterialsProvider

Cryptographic materials provider that uses a provider store to obtain cryptography materials. Materials obtained from the store are cached for a user-defined amount of time, then removed from the cache and re-retrieved from the store.

When encrypting, the most recent provider that the provider store knows about will always be used.

Parameters:
  • provider_store (ProviderStore) – Provider store to use
  • material_name (str) – Name of materials for which to ask the provider store
  • version_ttl (float) – Max time in seconds to go until checking with provider store for a more recent version
  • cache_size (int) – The maximum number of entries that the cache can hold
decryption_materials(encryption_context)[source]

Return decryption materials.

Parameters:encryption_context (EncryptionContext) – Encryption context for request
Raises:AttributeError – if no decryption materials are available
encryption_materials(encryption_context)[source]

Return encryption materials.

Parameters:encryption_context (EncryptionContext) – Encryption context for request
Raises:AttributeError – if no encryption materials are available
refresh()[source]

Clear all local caches for this provider.