Udostępnij przez


CryptoConfig.EncodeOID(String) Metoda

Definicja

Przestroga

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

Koduje określony identyfikator obiektu (OID).

public:
 static cli::array <System::Byte> ^ EncodeOID(System::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")]
public static byte[] EncodeOID (string str);
static member EncodeOID : string -> byte[]
[<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[]
Public Shared Function EncodeOID (str As String) As Byte()

Parametry

str
String

OID do kodowania.

Zwraca

Byte[]

Tablica bajtów zawierająca zakodowany identyfikator OID.

Atrybuty

Wyjątki

Parametr str to null.

Wystąpił błąd podczas kodowania identyfikatora OID.

Przykłady

W poniższym przykładzie kodu pokazano, jak wywołać metodę EncodeOID w celu zakodowania określonego identyfikatora obiektu. Ten przykład kodu jest częścią większego przykładu podanego CryptoConfig dla klasy.

array<Byte>^encodedMessage = CryptoConfig::EncodeOID( sha1Oid );
// 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)

Dotyczy

Zobacz też