Class ObjectIdentifier
- All Implemented Interfaces:
Serializable
Object Identifiers are arbitrary length hierarchical identifiers. The individual components are numbers, and they define paths from the root of an ISO-managed identifier space. You will sometimes see a string name used instead of (or in addition to) the numerical id. These are synonyms for the numerical IDs, but are not widely used since most sites do not know all the requisite strings, while all sites can parse the numeric forms.
So for example, JavaSoft has the sole authority to assign the meaning to identifiers below the 1.3.6.1.4.42.2.17 node in the hierarchy, and other organizations can easily acquire the ability to assign such unique identifiers.
- Version:
- 1.23
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private int
private BigInteger[]
private static Map
<String, ObjectIdentifier> Netscape Enhancement: This function implements a object identifier factory.private static final long
use serialVersionUID from JDK 1.1. -
Constructor Summary
ConstructorsConstructorDescriptionObjectIdentifier
(int[] values) Constructs an object ID from an array of integers.ObjectIdentifier
(long[] values) Constructs an object ID from an array of longs This is used to construct constant object IDs.ObjectIdentifier
(String oid) Constructs an object identifier from a string.ObjectIdentifier
(BigInteger[] values) Constructs an object ID from an ASN.1 encoded input stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(DerOutputStream out) boolean
boolean
equals
(ObjectIdentifier other) Compares this identifier with another, for equality.private static BigInteger
static ObjectIdentifier
getObjectIdentifier
(int[] values) static ObjectIdentifier
int
hashCode()
private void
initFromEncoding
(DerInputStream in, int bufferEnd) boolean
precedes
(ObjectIdentifier other) Compares this identifier with another, for sorting purposes.private static void
putComponentBigInt
(DerOutputStream out, BigInteger val) toString()
Returns a string form of the object ID.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDuse serialVersionUID from JDK 1.1. for interoperability- See Also:
-
components
-
componentLen
private int componentLen -
ALLOCATION_QUANTUM
private static final int ALLOCATION_QUANTUM- See Also:
-
mOIDs
Netscape Enhancement: This function implements a object identifier factory. It should help reduces in-memory Object Identifier object. This function also provide additional checking on the OID. A valid OID should start with 0, 1, or 2. Notes: This function never returns null. IOException is raised in error conditions.
-
-
Constructor Details
-
ObjectIdentifier
Constructs an object identifier from a string. This string should be of the form 1.23.34.45.56 etc. -
ObjectIdentifier
public ObjectIdentifier(int[] values) Constructs an object ID from an array of integers. This is used to construct constant object IDs. -
ObjectIdentifier
-
ObjectIdentifier
public ObjectIdentifier(long[] values) Constructs an object ID from an array of longs This is used to construct constant object IDs. -
ObjectIdentifier
Constructs an object ID from an ASN.1 encoded input stream. The encoding of the ID in the stream uses "DER", a BER/1 subset. In this case, that means a triple { typeId, length, data }.NOTE: When an exception is thrown, the input stream has not been returned to its "initial" state.
- Parameters:
in
- DER-encoded data holding an object ID- Throws:
IOException
- indicates a decoding error
-
ObjectIdentifier
ObjectIdentifier(DerInputBuffer buf) throws IOException - Throws:
IOException
-
-
Method Details
-
initFromEncoding
- Throws:
IOException
-
encode
- Throws:
IOException
-
getComponentBigInt
- Throws:
IOException
-
putComponentBigInt
-
precedes
Compares this identifier with another, for sorting purposes. An identifier does not precede itself.- Parameters:
other
- identifer that may precede this one.- Returns:
- true iff other precedes this one in a particular sorting order.
-
equals
-
equals
Compares this identifier with another, for equality.- Returns:
- true iff the names are identical.
-
hashCode
public int hashCode() -
toString
Returns a string form of the object ID. The format is the conventional "dot" notation for such IDs, without any user-friendly descriptive strings, since those strings will not be understood everywhere. -
getObjectIdentifier
- Throws:
IOException
-
getObjectIdentifier
- Throws:
IOException
-