public static void UseAwsKeyManagementServiceSerializerWithMemoryCache(
            this IBusFactoryConfigurator configurator,
            string kmsKeyId, IDistributedCacheEntryOptionsFactory distributedCacheEntryOptionsFactory)
        {
            var options = CreateDefaultMemoryDistributedCacheOptions();

            configurator.UseAwsKeyManagementServiceSerializerWithMemoryCache(kmsKeyId, options, distributedCacheEntryOptionsFactory);
        }
        public static void UseAwsKeyManagementServiceSerializerWithMemoryCache(
            this IReceiveEndpointConfigurator configurator,
            string kmsKeyId, IOptions <MemoryDistributedCacheOptions> options, IDistributedCacheEntryOptionsFactory distributedCacheEntryOptionsFactory)
        {
            var amazonKeyManagementServiceClient = CreateDefaultAmazonKeyManagementServiceClient();

            configurator.UseAwsKeyManagementServiceSerializerWithMemoryCache(kmsKeyId, amazonKeyManagementServiceClient, options, distributedCacheEntryOptionsFactory);
        }
 public static void UseAwsKeyManagementServiceSerializerWithMemoryCache(
     this IReceiveEndpointConfigurator configurator,
     string kmsKeyId, IAmazonKeyManagementService amazonKeyManagementService,
     IOptions <MemoryDistributedCacheOptions> options, IDistributedCacheEntryOptionsFactory distributedCacheEntryOptionsFactory)
 {
     configurator.UseAwsKeyManagementServiceSerializerWithCache(kmsKeyId, amazonKeyManagementService,
                                                                new MemoryDistributedCache(options), distributedCacheEntryOptionsFactory);
 }
        public static void UseAwsKeyManagementServiceSerializerWithMemoryCache(
            this IReceiveEndpointConfigurator configurator,
            RegionEndpoint region, string kmsKeyId, IDistributedCacheEntryOptionsFactory cacheEntryOptionsFactory)
        {
            var options = CreateDefaultMemoryDistributedCacheOptions();

            configurator.UseAwsKeyManagementServiceSerializerWithMemoryCache(region, kmsKeyId, options, cacheEntryOptionsFactory);
        }
 public DataKeyCache(ICacheKeyGenerator cacheKeyGenerator,
                     IDistributedCache distributedCache, ICacheValueConverter cacheValueConverter,
                     IDistributedCacheEntryOptionsFactory distributedCacheEntryOptionsFactory)
 {
     _cacheKeyGenerator   = cacheKeyGenerator;
     _distributedCache    = distributedCache;
     _cacheValueConverter = cacheValueConverter;
     _distributedCacheEntryOptionsFactory = distributedCacheEntryOptionsFactory;
 }
        public static void UseAwsKeyManagementServiceSerializerWithCache(this IReceiveEndpointConfigurator configurator,
                                                                         IKeyManagementService amazonKeyManagementService,
                                                                         IEncryptionContextBuilder encryptionContextBuilder,
                                                                         string kmsKeyId,
                                                                         IDistributedCache distributedCache,
                                                                         ICacheKeyGenerator cacheKeyGenerator,
                                                                         ICacheValueConverter cacheValueConverter,
                                                                         IDistributedCacheEntryOptionsFactory distributedCacheEntryOptionsFactory)
        {
            var dataKeyCache    = new DataKeyCache(cacheKeyGenerator, distributedCache, cacheValueConverter, distributedCacheEntryOptionsFactory);
            var decryptKeyCache = new DecryptKeyCache(cacheKeyGenerator, distributedCache, distributedCacheEntryOptionsFactory);

            configurator.UseAwsKeyManagementServiceSerializerWithCache(amazonKeyManagementService, encryptionContextBuilder,
                                                                       kmsKeyId, dataKeyCache, decryptKeyCache);
        }
        public static void UseAwsKeyManagementServiceSerializerWithCache(this IReceiveEndpointConfigurator configurator,
                                                                         string kmsKeyId, IAmazonKeyManagementService amazonKeyManagementService, IDistributedCache distributedCache,
                                                                         IDistributedCacheEntryOptionsFactory distributedCacheEntryOptionsFactory)
        {
            var amazonKeyManagementServiceWrapper = new AmazonKeyManagementServiceWrapper(amazonKeyManagementService);

            var emptyEncryptionContextBuilder = CreateDefaultEncryptionContextBuilder();

            var cacheKeyGenerator = CreateDefaultCacheKeyGenerator();

            var cacheValueConverter = CreateDefaultCacheValueConverter();

            configurator.UseAwsKeyManagementServiceSerializerWithCache(amazonKeyManagementServiceWrapper,
                                                                       emptyEncryptionContextBuilder,
                                                                       kmsKeyId, distributedCache, cacheKeyGenerator, cacheValueConverter, distributedCacheEntryOptionsFactory);
        }
 public DecryptKeyCache(ICacheKeyGenerator cacheKeyGenerator, IDistributedCache distributedCache, IDistributedCacheEntryOptionsFactory distributedCacheEntryOptionsFactory)
 {
     _cacheKeyGenerator = cacheKeyGenerator;
     _distributedCache  = distributedCache;
     _distributedCacheEntryOptionsFactory = distributedCacheEntryOptionsFactory;
 }