Share via


CryptoConfig.MapNameToOID(String) 方法

定义

获取与指定的简单名称对应的算法的对象标识符 (OID)。

public:
 static System::String ^ MapNameToOID(System::String ^ name);
public static string? MapNameToOID (string name);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static string? MapNameToOID (string name);
public static string MapNameToOID (string name);
static member MapNameToOID : string -> string
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member MapNameToOID : string -> string
Public Shared Function MapNameToOID (name As String) As String

参数

name
String

获取其 OID 的算法的简单名称。

返回

指定算法的 OID。

属性

例外

name 参数为 null

示例

下面的代码示例演示如何调用 MapNameToOID 方法,以从 SHA1 算法的字符串名称 (OID) 检索对象标识符。 此代码示例是为 CryptoConfig 类提供的一个更大示例的一部分。

String^ sha1Oid = CryptoConfig::MapNameToOID( L"SHA1" );
// This example uses the SHA1 algorithm.
// Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
string sha1Oid = CryptoConfig.MapNameToOID("SHA1");
' (OID) from the string name of the SHA1 algorithm.
' This example uses the SHA1 algorithm.
' Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
Dim sha1Oid As String = cryptoConfig.MapNameToOID("SHA1")

注解

有关此类识别的简单名称的列表,请参阅 CryptoConfig

适用于

另请参阅