Nyelv

CryptoConfig.EncodeOID(String) Metódus

Definíció

Figyelemfelhívás

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

A megadott objektumazonosítót (OID) kódolja.

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

Paraméterek

str
String

A kódolandó OID.

Válaszok

Byte[]

A kódolt OID-t tartalmazó bájttömb.

Attribútumok

Kivételek

A str paraméter a következő null: .

Hiba történt az OID kódolása közben.

Példák

Az alábbi példakód bemutatja, hogyan hívhatja meg a metódust a EncodeOID megadott objektumazonosító kódolásához. Ez a példakód egy nagyobb, az CryptoConfig osztályhoz tartozó példa része.

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

A következőre érvényes:

Lásd még