<cryptoNameMapping> Element

 

Contains mappings of classes to friendly names.

<configuration>
<mscorlib>
<cryptographySettings>
<cryptoNameMapping>

  
      <cryptoNameMapping>   
</cryptoNameMapping>  

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

Attributes

None.

Child Elements

ElementDescription
cryptoClassesContains a list of cryptography classes that have a mapping to a friendly name in the <nameEntry> element.
nameEntryMaps a class name to a friendly algorithm name, which allows one class to have many friendly names.

Parent Elements

ElementDescription
configurationThe root element in every configuration file used by the common language runtime and .NET Framework applications.
cryptographySettingsContains cryptography settings.
cryptoNameMappingContains mappings of classes to friendly names.
mscorlibContains the <cryptographySettings> element.

The following example shows how to use the <cryptoNameMapping> element to reference a cryptography class and to configure the runtime. You can then pass the string "RSA" to the CryptoConfig.CreateFromName method and use the Create method to 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 Schema
Cryptography Settings Schema
Cryptographic Services
Configuring Cryptography Classes

Show: