CryptoConfig.EncodeOID Method (String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Encodes the specified object identifier (OID).

Namespace:   System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

public static byte[] EncodeOID(
	string str
)

Parameters

str
Type: System.String

The OID to encode.

Return Value

Type: System.Byte[]

A byte array containing the encoded OID.

Exception Condition
ArgumentNullException

The str parameter is null.

CryptographicUnexpectedOperationException

An error occurred while encoding the OID.

The following code example demonstrates how to call the EncodeOID method to encode the specified object identifier. This code example is part of a larger example provided for the CryptoConfig class.

byte[] encodedMessage = CryptoConfig.EncodeOID(sha1Oid);

.NET Framework
Available since 1.1
Return to top
Show: