Sdílet prostřednictvím


<cryptographySettings> Element

Contains cryptography settings.

<configuration> Element
  <mscorlib> Element for Cryptography Settings
    <cryptographySettings> Element

<cryptographySettings> 
</crytopgraphySettings>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

None.

Child Elements

Element

Description

<cryptoNameMapping>

Contains mappings of classes to friendly names.

<oidMap>

Contains ASN.1 object identifier (OID) mappings to classes.

Parent Elements

Element

Description

configuration

The root element in every configuration file used by the common language runtime and .NET Framework applications.

mscorlib

Contains the cryptographySettings element.

Example

The following example shows how use the <cryptographySettings> element to contain cryptography name mappings and OID mappings. This example configures the runtime so that System.Security.Cryptography.HashAlgorithm.Create returns a MyHashClass object and the MyCryptoClass class maps to the object identifier 1.3.36.2.1.

<configuration>
   <mscorlib>
      <cryptographySettings>
         <cryptoNameMapping>
            <cryptoClasses>
               <cryptoClass   MyHash="MyHashClass, MyAssembly
                  Culture=neutral, PublicKeyToken=a5d015c7d5a0b012,
                  Version=1.0.0.0"/>
               <cryptoClass   MyCrypto="MyCryptoClass, MyAssembly
                  Culture=neutral, PublicKeyToken=a5d015c7d5a0b012,
                  Version=1.0.0.0"/>
            </cryptoClasses>
            <nameEntry name="System.Security.Cryptography.HashAlgorithm"
                       class="MyHash"/>
         </cryptoNameMapping>
         <oidMap>
            <oidEntry OID="1.3.36.3.2.1"   name="MyCryptoClass"/>
         </oidMap>
      </cryptographySettings>
   </mscorlib>
</configuration>

See Also

Reference

Cryptography Settings Schema

Other Resources

Configuration File Schema for the .NET Framework

Cryptographic Services