System.Security.Cryptography.CryptoConfig.EncodeOID Method

Encodes the specified object identifier (OID).

Syntax

public static byte[] EncodeOID (string str)

Parameters

str
The OID to encode.

Returns

A byte array containing the encoded OID.

Remarks

A System.Security.Cryptography.CryptographicUnexpectedOperationException will be thrown if the OID is invalid, like:

  • if the OID string has less than two parts (e.g. "0");
  • if the encoded OID would be greater than 127 bytes;

A OverflowException will be thrown if a part of the OID is bigger than int.int.MaxValue.

Requirements

Namespace: System.Security.Cryptography
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0