<cryptoNameMapping> Element

Contains mappings of classes to friendly names.

<cryptoNameMapping> 
</cryptoNameMapping>

Attributes and Elements

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

Attributes

None.

Child Elements

Element Description

cryptoClasses

Contains a list of cryptography classes that have a mapping to a friendly name in the <nameEntry> element.

nameEntry

Maps a class name to a friendly algorithm name, which allows one class to have many friendly names.

Parent Elements

Element Description

configuration

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

cryptographySettings

Contains cryptography settings.

cryptoNameMapping

Contains mappings of classes to friendly names.

mscorlib

Contains the <cryptographySettings> element.

Example

The following example shows how to use the <cryptoNameMapping> element to contain a list of cryptography classes and mappings to friendly algorithm names. This example configures 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>

See Also

Reference

Cryptography Settings Schema

Other Resources

Configuration File Schema for the .NET Framework
Cryptographic Services
Configuring Cryptography Classes