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

適用於

另請參閱