public class OidType extends AbstractDERType implements DEREncoder
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
derItem
Integer to encode.
|
| Constructor and Description |
|---|
OidType(DERTag tag,
int[] item)
Creates a new oid type.
|
OidType(DERTag tag,
java.lang.String item)
Creates a new oid type.
|
OidType(int[] item)
Creates a new oid type.
|
OidType(java.lang.String item)
Creates a new oid type.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
decode(java.nio.ByteBuffer encoded)
Converts bytes in the buffer to an OID by reading from the current position to the limit, which assumes the bytes
of the integer are in big-endian order.
|
byte[] |
encode()
Encode this object into it's DER type.
|
protected static void |
isValid(int[] oid)
Checks whether the supplied oid is valid.
|
static int[] |
parse(java.lang.String oid)
Converts the supplied oid into an array on integers.
|
protected static int |
readInt(java.nio.ByteBuffer buffer)
Reads the necessary encoded bytes from the supplied buffer to create an integer.
|
protected static byte[] |
toBytes(int component)
Converts the supplied oid component to a byte array.
|
static byte[] |
toBytes(int[] oid)
Converts the supplied list of oid components to a byte array.
|
encode, readBufferpublic OidType(java.lang.String item)
item - to DER encodepublic OidType(int[] item)
item - to DER encodepublic OidType(DERTag tag, java.lang.String item)
tag - der tag associated with this typeitem - to DER encodejava.lang.IllegalArgumentException - if the der tag is constructedpublic OidType(DERTag tag, int[] item)
tag - der tag associated with this typeitem - to DER encodejava.lang.IllegalArgumentException - if the der tag is constructedpublic byte[] encode()
DEREncoderencode in interface DEREncoderpublic static java.lang.String decode(java.nio.ByteBuffer encoded)
encoded - buffer containing DER-encoded data where the buffer is positioned at the start of OID bytes and
the limit is set beyond the last byte of OID data.public static byte[] toBytes(int[] oid)
oid - to convertjava.lang.IllegalArgumentException - if the oid is not valid. See isValid(int[])protected static void isValid(int[] oid)
oid - to checkjava.lang.IllegalArgumentException - if the oid is not valid.protected static byte[] toBytes(int component)
component - to convert to bytesprotected static int readInt(java.nio.ByteBuffer buffer)
buffer - to readpublic static int[] parse(java.lang.String oid)
oid - to parsejava.lang.IllegalArgumentException - if the oid is not valid. See isValid(int[])