.NET Framework Class Library
CryptoConfig..::.MapNameToOID Method

Gets the object identifier (OID) of the algorithm corresponding to the specified simple name.

Namespace:  System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)
Syntax

Visual Basic (Declaration)
Public Shared Function MapNameToOID ( _
    name As String _
) As String
Visual Basic (Usage)
Dim name As String
Dim returnValue As String

returnValue = CryptoConfig.MapNameToOID(name)
C#
public static string MapNameToOID(
    string name
)
Visual C++
public:
static String^ MapNameToOID(
    String^ name
)
JScript
public static function MapNameToOID(
    name : String
) : String

Parameters

name
Type: System..::.String
The simple name of the algorithm for which to get the OID.

Return Value

Type: System..::.String
The OID of the specified algorithm.
Exceptions

ExceptionCondition
ArgumentNullException

The name parameter is nullNothingnullptra null reference (Nothing in Visual Basic).

Remarks

For a list of simple names recognized by this class, see CryptoConfig.

Examples

The following code example demonstrates how to call the MapNameToOID method to retrieve an object identifier (OID) from the string name of the SHA1 algorithm. This code example is part of a larger example provided for the CryptoConfig class.

Visual Basic
' (OID) from the string name of the SHA1 algorithm.
Dim sha1Oid As String = cryptoConfig.MapNameToOID("SHA1")
C#
string sha1Oid = CryptoConfig.MapNameToOID("SHA1");
Visual C++
String^ sha1Oid = CryptoConfig::MapNameToOID( L"SHA1" );
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0
See Also

Reference

Other Resources

Tags :


Page view tracker