Encodes the specified object identifier (OID).
str The OID to encode.
A byte array containing the encoded OID.
A System.Security.Cryptography.CryptographicUnexpectedOperationException will be thrown if the OID is invalid, like:
A OverflowException will be thrown if a part of the OID is bigger than int.int.MaxValue.