<mscorlib> 加密设置的元素

包含 <cryptographySettings> 元素

<配置><mscorlib>

Syntax

      <mscorlib>
</mscorlib>

特性和元素

下列各节描述了特性、子元素和父元素。

特性

没有。

子元素

元素 Description
cryptographySettings 包含加密设置。

父元素

元素 Description
configuration 公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。

Example

以下示例演示如何使用 <mscorlib> 元素引用加密类和配置运行时。 然后,可以将字符串“RSA”传递给 CryptoConfig.CreateFromName 该方法,并使用 Create 该方法返回对象 MyCryptoRSAClass

<configuration>
   <mscorlib>
      <cryptographySettings>
         <cryptoNameMapping>
            <cryptoClasses>
               <cryptoClass   MyCryptoRSA="MyCryptoRSAClass, MyAssembly
                  Culture=neutral, PublicKeyToken=a5d015c7d5a0b012,
                  Version=1.0.0.0"/>
            </cryptoClasses>
            <nameEntry name="RSA" class="MyCryptoRSA"/>
            <nameEntry name="System.Security.Cryptography.AsymmetricAlgorithm"
                       class="MyCryptoRSA"/>
         </cryptoNameMapping>
      </cryptographySettings>
   </mscorlib>
</configuration>

另请参阅