/// <summary>
        /// Creates an instance of <see cref="CacheStorageExtension"/> passing the current <see cref="IBackingStore"/>'s fluent interface builder.
        /// </summary>
        /// <param name="context">The current <see cref="IBackingStore"/>'s fluent interface builder.<br/>
        /// This interface must implement <see cref="ICachingConfigurationCacheStorageExtension"/>.</param>
        protected CacheStorageExtension(IBackingStoreEncryptItemsUsing context)
        {
            contextExtension = context as ICachingConfigurationCacheStorageExtension;

            if (contextExtension == null) throw new ArgumentException(
                string.Format(CultureInfo.CurrentCulture, Resources.ExceptionParameterMustImplement, typeof(ICachingConfigurationCacheStorageExtension).FullName),
                "context");
        }
        protected override void Arrange()
        {
            ConfigurationSourceBuilder = new ConfigurationSourceBuilder();

            CachingConfiguration = ConfigurationSourceBuilder.ConfigureCaching();

            ConfigureCacheManager = CachingConfiguration.ForCacheManagerNamed(cacheManagerName);

            EncryptUsing = ConfigureCacheManager.StoreInIsolatedStorage(cacheManagerStoreName).EncryptUsing;
        }
        protected override void Arrange()
        {
            ConfigurationSourceBuilder = new ConfigurationSourceBuilder();

            CachingConfiguration = ConfigurationSourceBuilder.ConfigureCaching();

            ConfigureCacheManager = CachingConfiguration.ForCacheManagerNamed(cacheManagerName);

            EncryptUsing = ConfigureCacheManager.StoreInIsolatedStorage(cacheManagerStoreName).EncryptUsing;
        }
            public EncryptItemsWithSharedSymmetricProviderBuilder(IBackingStoreEncryptItemsUsing context, string cacheStorageEncryptionProviderName)
                :base(context)

            {
                symmetricCacheStorageEncryption = new SymmetricStorageEncryptionProviderData
                {
                    Name = cacheStorageEncryptionProviderName
                };

                base.AddEncryptionProviderToCachingConfigurationAndBackingStore(symmetricCacheStorageEncryption);
            }
Exemplo n.º 5
0
        /// <summary>
        /// Creates an instance of <see cref="CacheStorageExtension"/> passing the current <see cref="IBackingStore"/>'s fluent interface builder.
        /// </summary>
        /// <param name="context">The current <see cref="IBackingStore"/>'s fluent interface builder.<br/>
        /// This interface must implement <see cref="ICachingConfigurationCacheStorageExtension"/>.</param>
        protected CacheStorageExtension(IBackingStoreEncryptItemsUsing context)
        {
            contextExtension = context as ICachingConfigurationCacheStorageExtension;

            if (contextExtension == null)
            {
                throw new ArgumentException(
                          string.Format(CultureInfo.CurrentCulture, Resources.ExceptionParameterMustImplement, typeof(ICachingConfigurationCacheStorageExtension).FullName),
                          "context");
            }
        }
Exemplo n.º 6
0
            public EncryptItemsWithSharedSymmetricProviderBuilder(IBackingStoreEncryptItemsUsing context, string cacheStorageEncryptionProviderName)
                : base(context)

            {
                symmetricCacheStorageEncryption = new SymmetricStorageEncryptionProviderData
                {
                    Name = cacheStorageEncryptionProviderName
                };

                base.AddEncryptionProviderToCachingConfigurationAndBackingStore(symmetricCacheStorageEncryption);
            }
Exemplo n.º 7
0
        /// <summary>
        /// Specifies the currently configured <see cref="IBackingStore"/> instance should be encrypted using a <see cref="SymmetricStorageEncryptionProvider"/>.
        /// </summary>
        /// <param name="context">Fluent interface extension point.</param>
        /// <param name="cacheStorageEncryptionProviderName">The name of the <see cref="SymmetricStorageEncryptionProvider"/> instance.</param>
        /// <returns>Fluent interface that can be used to further configure the <see cref="SymmetricStorageEncryptionProvider"/> instance.</returns>
        public static IEncryptItemsWithSharedSymmetricProvider SymmetricEncryptionProviderNamed(this IBackingStoreEncryptItemsUsing context, string cacheStorageEncryptionProviderName)
        {
            if (string.IsNullOrEmpty(cacheStorageEncryptionProviderName))
            {
                throw new ArgumentException(Resources.ExceptionStringNullOrEmpty, "cacheStorageEncryptionProviderName");
            }

            return(new EncryptItemsWithSharedSymmetricProviderBuilder(context, cacheStorageEncryptionProviderName));
        }