Package com.oss.asn1

Class ObjectIdentifier

All Implemented Interfaces:
Serializable, Cloneable

public class ObjectIdentifier extends AbstractObjectIdentifier
The ObjectIdentifier class represents the ASN.1 OBJECT IDENTIFIER type. ObjectIdentifier is an immutable class. Once constructed, an object of this class may not be modified.
Since:
ASN.1/Java 1.0-beta A
See Also:
  • Constructor Details

    • ObjectIdentifier

      public ObjectIdentifier()
      The default constructor.
    • ObjectIdentifier

      public ObjectIdentifier(String valueNotation) throws BadObjectIdentifierException
      Construct from a String. The String can contain ASN.1 Value Notation in the format: "{ 1 2 3 4 5 6 7 }" or in the format "1.2.3.4.5.6.7". With the first format, the blanks after the '{' and before the '}' are optional. If the string has some extra characters before the '{' or after the '}', they are simply ignored.
      Parameters:
      valueNotation - the value to set this object's value to.
      Throws:
      BadObjectIdentifierException - thrown if the String parameter does not contain valid ASN.1 Value Notation
    • ObjectIdentifier

      public ObjectIdentifier(byte[] value)
      Construct from a byte array. Each byte of the array (each subidentifier) must be a value that can be represented in one octet. So for example if one subidentifier has the value, 245 (0xF5 hex), then the correct representation is by two octets: 0x81 and 0x75, and the correct argument for the ObjectIdentifier(byte[]) will have a constructor containing (other values have been left blank): 'new byte[] { ... , (byte)0x81, (byte)0x75, ...}'.
      Parameters:
      value - the byte array value to set 'this' object to.
  • Method Details

    • equalTo

      public final boolean equalTo(ObjectIdentifier that)
      Compare 'this' object to another ObjectIdentifier object to see if their contents are the same.
      Parameters:
      that - the ObjectIdentifier object to compare 'this' object to.
      Returns:
      true if contents of both objects are the same.