예제 #1
0
        /// <summary>
        /// <para>Gets the <see cref="Type"/> of the <see cref="ISymmetricCryptoProvider"/> to create based on the name.</para>
        /// </summary>
        /// <param name="cryptoProviderName">
        /// <para>The name of the configuration object to create.</para>
        /// </param>
        /// <returns>
        /// <para>The <see cref="Type"/> of <see cref="ISymmetricCryptoProvider"/> to create.</para>
        /// </returns>
        protected override Type GetConfigurationType(string cryptoProviderName)
        {
            CryptographyConfigurationView cryptoConfigurationView     = (CryptographyConfigurationView)CreateConfigurationView();
            SymmetricCryptoProviderData   symmetricCryptoProviderData = cryptoConfigurationView.GetSymmetricCryptoProviderData(cryptoProviderName);

            return(GetType(symmetricCryptoProviderData.TypeName));
        }
예제 #2
0
        /// <summary>
        /// <para>Initializes the provider with a <see cref="CryptographyConfigurationView"/>.</para>
        /// </summary>
        /// <param name="configurationView">
        /// <para>A <see cref="CryptographyConfigurationView"/> object.</para>
        /// </param>
        public override void Initialize(ConfigurationView configurationView)
        {
            ArgumentValidation.CheckForNullReference(configurationView, "configurationView");
            ArgumentValidation.CheckExpectedType(configurationView, typeof(CryptographyConfigurationView));

            this.cryptoConfigurationView = (CryptographyConfigurationView)configurationView;
        }
예제 #3
0
        /// <summary>
        /// <para>Gets the <see cref="Type"/> of the <see cref="IHashProvider"/> to create based on the name.</para>
        /// </summary>
        /// <param name="hashProviderName">
        /// <para>The name of the configuration object to create.</para>
        /// </param>
        /// <returns>
        /// <para>The <see cref="Type"/> of <see cref="IHashProvider"/> to create.</para>
        /// </returns>
        protected override Type GetConfigurationType(string hashProviderName)
        {
            CryptographyConfigurationView cryptoConfigurationView = (CryptographyConfigurationView)CreateConfigurationView();
            HashProviderData hashProviderData = cryptoConfigurationView.GetHashProviderData(hashProviderName);

            return(GetType(hashProviderData.TypeName));
        }
        /// <summary>
        /// <para>Initializes the provider with a <see cref="CryptographyConfigurationView"/>.</para>
        /// </summary>
        /// <param name="configurationView">
        /// <para>A <see cref="CryptographyConfigurationView"/> object.</para>
        /// </param>
        public override void Initialize(ConfigurationView configurationView)
        {
            ArgumentValidation.CheckForNullReference(configurationView, "configurationView");
            ArgumentValidation.CheckExpectedType(configurationView, typeof(CryptographyConfigurationView));

            this.cryptoConfigurationView = (CryptographyConfigurationView)configurationView;
        }