CryptoConfig.EncodeOID(String) Methode

Definitie

Let op

EncodeOID is obsolete. Use the ASN.1 functionality provided in System.Formats.Asn1.

Codeert de opgegeven object-id (OID).

public:
 static cli::array <System::Byte> ^ EncodeOID(System::String ^ str);
[System.Obsolete("EncodeOID is obsolete. Use the ASN.1 functionality provided in System.Formats.Asn1.", DiagnosticId="SYSLIB0031", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static byte[] EncodeOID(string str);
public static byte[] EncodeOID(string str);
[<System.Obsolete("EncodeOID is obsolete. Use the ASN.1 functionality provided in System.Formats.Asn1.", DiagnosticId="SYSLIB0031", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member EncodeOID : string -> byte[]
static member EncodeOID : string -> byte[]
Public Shared Function EncodeOID (str As String) As Byte()

Parameters

str
String

De OID om te coderen.

Retouren

Byte[]

Een bytematrix met de gecodeerde OID.

Kenmerken

Uitzonderingen

De str parameter is null.

Er is een fout opgetreden tijdens het coderen van de OID.

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u de EncodeOID methode aanroept om de opgegeven object-id te coderen. Dit codevoorbeeld maakt deel uit van een groter voorbeeld voor de CryptoConfig klasse.

// This example uses the SHA1 algorithm.
// Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
byte[] encodedMessage = CryptoConfig.EncodeOID(sha1Oid);
' This example uses the SHA1 algorithm.
' Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
Dim encodedMessage() As Byte = cryptoConfig.EncodeOID(sha1Oid)

Van toepassing op

Zie ook