CryptoConfig.EncodeOID(String) メソッド

定義

注意事項

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

指定したオブジェクト識別子 (OID: Object IDentifier) をエンコードします。

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

パラメーター

str
String

エンコードする OID。

戻り値

Byte[]

エンコードされた OID を格納するバイト配列。

属性

例外

str パラメーターが null です。

OID のエンコーディング中にエラーが発生しました。

次のコード例では、メソッドを呼び出 EncodeOID して、指定したオブジェクト識別子をエンコードする方法を示します。 このコード例は、CryptoConfig クラスのために提供されている大規模な例の一部です。

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)

適用対象

こちらもご覧ください