Поделиться через


<cryptoClass> Element

Contains a cryptography class that has a mapping to a friendly name in the <nameEntry> element.

<configuration>
   <mscorlib>
      <cryptographySettings>
         <cryptoNameMapping>
            <cryptoClasses>
               <cryptoClass>

<cryptoClass customClassName="fully qualified type name" />

Required Attributes

Attribute Description
customClassName Contains the information for the cryptography class. Use this attribute to provide a short name for your class. You must specify a string that meets the requirements specified in Specifying Fully Qualified Type Names.

Example

The following example shows how use the <cryptoClass> element to reference a cryptography class and to configure the runtime so that System.Security.CryptoConfig.CreateFromName("RSA") and System.Security.Cryptography.AsymmetricAlgorithm.Create return a MyCryptoRSAClass object.

<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>

Configuration File

This element can be used in the machine configuration file (Machine.config).

See Also

Configuration File Schema | Cryptography Settings Schema | Cryptographic Services | Configuring Cryptography Classes