Compartir a través de


<cryptographySettings> Element

Contains cryptography settings.

<configuration>
   <mscorlib>
      <cryptographySettings>

<cryptographySettings>
</crytopgraphySettings>

Child Elements

Element Description
<cryptoNameMapping> Contains mappings of classes to friendly names.
<oidMap> Contains ASN.1 object identifier (OID) mappings to classes.

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>

Configuration File

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

See Also

Configuration File Schema | Cryptography Settings Schema | Cryptographic Services