Share via


CryptoConfig.MapNameToOID(String) Méthode

Définition

Obtient l'identificateur de l'objet (OID) de l'algorithme correspondant au nom simple spécifié.

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

Paramètres

name
String

Nom simple de l'algorithme pour lequel l'OID doit être obtenu.

Retours

OID de l'algorithme spécifié.

Attributs

Exceptions

Le paramètre name a la valeur null.

Exemples

L’exemple de code suivant montre comment appeler la MapNameToOID méthode pour récupérer un identificateur d’objet (OID) à partir du nom de chaîne de l’algorithme SHA1. Cet exemple de code fait partie d’un exemple plus grand fourni pour la CryptoConfig classe .

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")

Remarques

Pour obtenir la liste des noms simples reconnus par cette classe, consultez CryptoConfig.

S’applique à

Voir aussi