Class LocalCryptoMaterialsCache

java.lang.Object
com.amazonaws.encryptionsdk.caching.LocalCryptoMaterialsCache
All Implemented Interfaces:
CryptoMaterialsCache

public class LocalCryptoMaterialsCache extends Object implements CryptoMaterialsCache
A simple implementation of the CryptoMaterialsCache using a basic LRU cache.

Example usage:


 LocalCryptoMaterialsCache cache = new LocalCryptoMaterialsCache(500);

 CachingCryptoMaterialsManager materialsManager = CachingCryptoMaterialsManager.builder()
      .setMaxAge(5, TimeUnit.MINUTES)
      .setCache(cache)
      .withMasterKeyProvider(myMasterKeyProvider)
      .build();

 byte[] data = new AwsCrypto().encryptData(materialsManager, plaintext).getResult();
 
  • Constructor Details

    • LocalCryptoMaterialsCache

      public LocalCryptoMaterialsCache(int capacity)
  • Method Details