Skip to content

[Question] Migrating from 2.4.1 to 3.0.0 #2035

Closed
@mode-ankit-khandelwal

Description

@mode-ankit-khandelwal

Problem:

Hello ESDK team 🙏

  1. How do we migrate from CachingCryptoMaterialsManager to ICryptographicMaterialsManager and ICryptographicMaterialsCache?
  2. How to restrict KeyRings to single keys similar to KmsMasterKeyProvider.builder().buildStrict(keyARN)?

Our existing code usage looks similar to below

OurCrypto(String keyID, String region, int cacheCapacity, int cacheMaxAgeMinutes, String accountId, RegionalClientSupplier factory) {
  this.encryptionKeyProvider = KmsMasterKeyProvider
      .builder()
      .customRegionalClientSupplier(factory)
      .defaultRegion(Region.of(region))
      .buildStrict(keyID);
  
  var decryptionKeyProvider = KmsMasterKeyProvider
      .builder()
      .customRegionalClientSupplier(factory)
      .defaultRegion(Region.of(region))
      .buildDiscovery(new DiscoveryFilter(PARTITION, List.of(accountId)));
  
  this.manager = CachingCryptoMaterialsManager.newBuilder()
      .withMasterKeyProvider(decryptionKeyProvider)
      .withCache(new LocalCryptoMaterialsCache(cacheCapacity))
      .withMaxAge(cacheMaxAgeMinutes, TimeUnit.MINUTES)
      .build();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions