|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.api.asn1.util.Oid
public class Oid
This class implement an Oid (Object Identifier).
An Oid is encoded as a list of bytes representing integers.
An Oid has a numeric representation where number are separated with dots :
SPNEGO Oid = 1.3.6.1.5.5.2
Translating from a byte list to a dot separated list of number follows the rules :
1.3 -> 0x2B (1*40 + 3 = 43 = 0x2B) .6 -> 0x06 .1 -> 0x01 .5 -> 0x05 .5 -> 0x05 .2 -> 0x02
1.2 -> 0x2A (1*40 + 2 = 42 = 0x2A) 840 -> 0x86 0x48 (840 = 6 * 128 + 72 = (0x06 | 0x80) 0x48 = 0x86 0x48 48018 -> 0x82 0xF7 0x12 (2 * 128 * 128 + 119 * 128 + 18 = (0x02 | 0x80) (0x77 | 0x80) 0x12 .1 -> 0x01 .2 -> 0x02 .2 -> 0x02
| Constructor Summary | |
|---|---|
Oid()
Creates a new Oid object. |
|
Oid(byte[] oid)
Create a new Oid object from a byte array |
|
Oid(String oid)
Create a new Oid object from a String |
|
| Method Summary | |
|---|---|
boolean |
equals(Object oid)
|
byte[] |
getOid()
Get an array of bytes from the Oid |
int |
getOidLength()
Get the number of bytes necessary to store the Oid |
long[] |
getOidValues()
Get an array of long from the Oid |
int |
hashCode()
|
static boolean |
isOid(String oid)
Check that an Oid is valid |
void |
setOid(byte[] oid)
Set the Oid. |
void |
setOid(String oid)
Set the Oid. |
String |
toString()
Get the Oid as a String |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Oid()
public Oid(byte[] oid)
throws DecoderException
oid - the byte array containing the Oid
DecoderException - if the byte array does not contain a
valid Oid
public Oid(String oid)
throws DecoderException
oid - The String which is supposed to be an Oid
DecoderException - if the byte array does not contain a
valid Oid| Method Detail |
|---|
public void setOid(byte[] oid)
throws DecoderException
oid - The bytes containing the Oid
DecoderException - if the byte array does not contains a valid Oid
public void setOid(String oid)
throws DecoderException
oid - The String containing the Oid
DecoderException - if the byte array does not contains a valid Oidpublic long[] getOidValues()
public int getOidLength()
public byte[] getOid()
public static boolean isOid(String oid)
oid - The oid to be checked
true if the Oid is validpublic String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object oid)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||