public class Oid extends Object
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 and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
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
|
public Oid()
public Oid(byte[] oid) throws DecoderException
oid
- the byte array containing the OidDecoderException
- if the byte array does not contain a
valid Oidpublic Oid(String oid) throws DecoderException
oid
- The String which is supposed to be an OidDecoderException
- if the byte array does not contain a
valid Oidpublic void setOid(byte[] oid) throws DecoderException
oid
- The bytes containing the OidDecoderException
- if the byte array does not contains a valid Oidpublic void setOid(String oid) throws DecoderException
oid
- The String containing the OidDecoderException
- 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 checkedtrue
if the Oid is validCopyright © 2003–2014 The Apache Software Foundation. All rights reserved.