|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.asn1new.primitives.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 : - the first number is in [0..2] - the second number is in [0..39] if the first number is 0 or 1 - the first byte has a value equal to : number 1 * 40 + number two - the upper bit of a byte is set if the next byte is a part of the number For instance, the SPNEGO Oid (1.3.6.1.5.5.2) will be encoded : 1.3 -> 0x2B (1*40 + 3 = 43 = 0x2B) .6 -> 0x06 .1 -> 0x01 .5 -> 0x05 .5 -> 0x05 .2 -> 0x02 The Kerberos V5 Oid (1.2.840.48018.1.2.2) will be encoded : 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
Field Summary | |
private int[] |
oidValues
The OID as a array of int |
private static long |
serialVersionUID
|
Constructor Summary | |
OID()
Creates a new OID object. |
|
OID(byte[] oid)
Create a new OID object from a byte array |
|
OID(java.lang.String oid)
Create a new OID object from a String |
Method Summary | |
byte[] |
getOID()
Get an array of bytes from the OID |
int |
getOIDLength()
Get the number of bytes necessary to store the OID |
int[] |
getOIDValues()
Get an array of int from the OID |
void |
setOID(byte[] oid)
Set the OID. |
void |
setOID(java.lang.String oid)
Set the OID. |
java.lang.String |
toString()
Get the OID as a String |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final long serialVersionUID
private int[] oidValues
Constructor Detail |
public OID()
public OID(byte[] oid) throws org.apache.asn1.codec.DecoderException
oid
- public OID(java.lang.String oid) throws org.apache.asn1.codec.DecoderException
oid
- The String which is supposed to be an OIDMethod Detail |
public void setOID(byte[] oid) throws org.apache.asn1.codec.DecoderException
oid
- The bytes containing the OID
org.apache.asn1.codec.DecoderException
public void setOID(java.lang.String oid) throws org.apache.asn1.codec.DecoderException
oid
- The String containing the OID
org.apache.asn1.codec.DecoderException
public int[] getOIDValues()
public int getOIDLength()
public byte[] getOID()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |