Exemplo n.º 1
0
        /// <summary>
        /// <para>Gets the <see cref="Type"/> of the <see cref="IStorageEncryptionProvider"/> for the factory to create for a <see cref="CacheManager"/>.</para>
        /// </summary>
        /// <param name="cacheManagerName">
        /// <para>The name of the cache manager to create the <see cref="IStorageEncryptionProvider"/>.</para>
        /// </param>
        /// <returns>
        /// <para>The <see cref="Type"/> of the <see cref="IStorageEncryptionProvider"/> to create.</para>
        /// </returns>
        protected override Type GetConfigurationType(string cacheManagerName)
        {
            CachingConfigurationView      view = (CachingConfigurationView)CreateConfigurationView();
            StorageEncryptionProviderData data = view.GetStorageEncryptionProviderData(cacheManagerName);

            return(GetType(data.TypeName));
        }
        protected override StorageEncryptionProviderData GetConfiguration(string name, IConfigurationSource configurationSource)
        {
            CachingConfigurationView view = new CachingConfigurationView(configurationSource);

            return(view.GetStorageEncryptionProviderData(name));
        }
Exemplo n.º 3
0
        private ISymmetricCryptoProvider CreateProvider()
        {
            SymmetricCryptoProviderFactory         factory = new SymmetricCryptoProviderFactory(cachingConfigurationView.ConfigurationContext);
            SymmetricStorageEncryptionProviderData data    = (SymmetricStorageEncryptionProviderData)cachingConfigurationView.GetStorageEncryptionProviderData(ConfigurationName);

            return(factory.CreateSymmetricCryptoProvider(data.SymmetricInstance));
        }