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.1.42.2.17 node in the hierarchy, and other organizations can easily acquire the ability to assign such unique identifiers.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private Object | components
Changed to Object |
| private transient boolean | |
| private byte[] | encoding
We use the DER value (no tag, no length) as the internal format |
| private static final int | |
| private static final ConcurrentHashMap | |
| private static final long | |
| private transient volatile String |
| Access | Constructor and Description |
|---|---|
| private | |
| pack-priv | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| pack-priv void | |
| public boolean | Returns: true iff the names are identical.Overrides java. Compares this identifier with another, for equality. |
| public int | |
| private void | |
| public static ObjectIdentifier | |
| public static ObjectIdentifier | |
| private static byte[] | Returns: the repacked bytesthe input byte array in, int start point inside ioffset, int innumber of bytes to repack ilength, int NUB for input iw, int NUB for output ow)Repack all bits from input to output. |
| private static int | Returns: the number of bytes pastedthe existing array to be pasted into out, int the starting position to paste ooffset)Repack from NUB 8 to a NUB 7 OID sub-identifier, remove all unnecessary 0 headings, set the first bit of all non-tail output bytes to 1 (as ITU-T Rec. |
| private static int | |
| private static int | pack7Oid(BigInteger input, byte[] out, int ooffset)
Pack the BigInteger into a OID subidentifier DER encoding |
| private static int | Returns: the number of bytes pastedthe existing array to be pasted into out, int the starting position to paste ooffset)Repack from NUB 7 to NUB 8, remove all unnecessary 0 headings, and paste it into an existing byte array. |
| private void | readObject(ObjectInputStream
the is)ObjectInputStream from which data is readRestores the state of this object from the stream. |
| private int[] | Returns: components in an int array, if all the components are less than Integer.MAX_VALUE. Otherwise, null.Private helper method for serialization. |
| public String | toString()
Overrides java. 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. |
| private void |
| componentLen | back to summary |
|---|---|
| private int componentLen | |
| components | back to summary |
|---|---|
| private Object components Changed to Object
| |
| componentsCalculated | back to summary |
|---|---|
| private transient boolean componentsCalculated | |
| encoding | back to summary |
|---|---|
| private byte[] encoding We use the DER value (no tag, no length) as the internal format | |
| MAXIMUM_OID_SIZE | back to summary |
|---|---|
| private static final int MAXIMUM_OID_SIZE | |
| oidTable | back to summary |
|---|---|
| private static final ConcurrentHashMap<String, ObjectIdentifier> oidTable | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID
| |
| stringForm | back to summary |
|---|---|
| private transient volatile String stringForm | |
| ObjectIdentifier | back to summary |
|---|---|
| private ObjectIdentifier(String oid) throws IOException Constructs, from a string. This string should be of the form 1.23.56. Validity check included. | |
| ObjectIdentifier | back to summary |
|---|---|
| pack-priv ObjectIdentifier(byte[] encoding) throws IOException | |
| ObjectIdentifier | back to summary |
|---|---|
| public ObjectIdentifier(DerInputStream in) throws IOException Reads an ObjectIdentifier from a DerInputStream.
| |
| check | back to summary |
|---|---|
| private static void check(byte[] encoding) throws IOException Check the DER encoding. Since DER encoding defines that the integer bits are unsigned, so there's no need to check the MSB. | |
| checkCount | back to summary |
|---|---|
| private static void checkCount(int count) throws IOException | |
| checkFirstComponent | back to summary |
|---|---|
| private static void checkFirstComponent(int first) throws IOException | |
| checkFirstComponent | back to summary |
|---|---|
| private static void checkFirstComponent(BigInteger first) throws IOException | |
| checkOidSize | back to summary |
|---|---|
| private static void checkOidSize(int oidLength) throws IOException | |
| checkOtherComponent | back to summary |
|---|---|
| private static void checkOtherComponent(int i, int num) throws IOException | |
| checkOtherComponent | back to summary |
|---|---|
| private static void checkOtherComponent(int i, BigInteger num) throws IOException | |
| checkSecondComponent | back to summary |
|---|---|
| private static void checkSecondComponent(int first, int second) throws IOException | |
| checkSecondComponent | back to summary |
|---|---|
| private static void checkSecondComponent(int first, BigInteger second) throws IOException | |
| encode | back to summary |
|---|---|
| pack-priv void encode(DerOutputStream out) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Compares this identifier with another, for equality.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| init | back to summary |
|---|---|
| private void init(int[] components, int length) throws IOException | |
| of | back to summary |
|---|---|
| public static ObjectIdentifier of(String oidStr) throws IOException Returns an ObjectIdentifier instance for the specific String. If the String is not a valid OID string, an IOException is thrown. | |
| of | back to summary |
|---|---|
| public static ObjectIdentifier of(KnownOIDs o) Returns an ObjectIdentifier instance for the specific KnownOIDs. | |
| pack | back to summary |
|---|---|
| private static byte[] pack(byte[] in, int ioffset, int ilength, int iw, int ow) Repack all bits from input to output. On the both sides, only a portion (from the least significant bit) of the 8 bits in a byte is used. This number is defined as the number of useful bits (NUB) for the array. All used bits from the input byte array and repacked into the output in the exactly same order. The output bits are aligned so that the final bit of the input (the least significant bit in the last byte), when repacked as the final bit of the output, is still at the least significant position. Zeroes will be padded on the left side of the first output byte if necessary. All unused bits in the output are also zeroed. For example: if the input is 01001100 with NUB 8, the output which has a NUB 6 will look like: 00000001 00001100 The first 2 bits of the output bytes are unused bits. The other bits turn out to be 000001 001100. While the 8 bits on the right are from the input, the left 4 zeroes are padded to fill the 6 bits space.
| |
| pack7Oid | back to summary |
|---|---|
| private static int pack7Oid(byte[] in, int ioffset, int ilength, byte[] out, int ooffset) Repack from NUB 8 to a NUB 7 OID sub-identifier, remove all unnecessary 0 headings, set the first bit of all non-tail output bytes to 1 (as ITU-T Rec. X.690 8.19.2 says), and paste it into an existing byte array.
| |
| pack7Oid | back to summary |
|---|---|
| private static int pack7Oid(int input, byte[] out, int ooffset) Pack the int into a OID sub-identifier DER encoding | |
| pack7Oid | back to summary |
|---|---|
| private static int pack7Oid(BigInteger input, byte[] out, int ooffset) Pack the BigInteger into a OID subidentifier DER encoding | |
| pack8 | back to summary |
|---|---|
| private static int pack8(byte[] in, int ioffset, int ilength, byte[] out, int ooffset) Repack from NUB 7 to NUB 8, remove all unnecessary 0 headings, and paste it into an existing byte array.
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException Restores the state of this object from the stream.
| |
| toIntArray | back to summary |
|---|---|
| private int[] toIntArray() Private helper method for serialization. To be compatible with old versions of JDK.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. 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.
| |
| writeObject | back to summary |
|---|---|
private void writeObject(ObjectOutputStream os) throws IOException
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long | |
| pack-priv static ObjectIdentifier. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID
| |
| theOne | back to summary |
|---|---|
| pack-priv static ObjectIdentifier. | |
| HugeOidNotSupportedByOldJDK | back to summary |
|---|---|
| pack-priv HugeOidNotSupportedByOldJDK() | |