|
JMRTD 0.4.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.scuba.tlv.BERTLVObject
public class BERTLVObject
Generic data structure for storing Tag Length Value (TLV) objects encoded according to the Basic Encoding Rules (BER). Written by Martijn Oostdijk (MO) and Cees-Bart Breunesse (CB) of the Security of Systems group (SoS) of the Institute of Computing and Information Sciences (ICIS) at Radboud University (RU). Based on ISO 7816-4 Annex D (which apparently is based on ISO 8825 and/or X.208, X.209, X.680, X.690). See ASN.1.
| Field Summary | |
|---|---|
static int |
APPLICATION_CLASS
Application tag class. |
static int |
BIT_STRING_TYPE_TAG
Universal tag type. |
static int |
BMP_STRING_TYPE_TAG
Universal tag type. |
static int |
BOOLEAN_TYPE_TAG
Universal tag type. |
static int |
CONTEXT_SPECIFIC_CLASS
Context specific tag class. |
static int |
EMBEDDED_PDV_TYPE_TAG
Universal tag type. |
static int |
ENUMERATED_TYPE_TAG
Universal tag type. |
static int |
EXTERNAL_TYPE_TAG
Universal tag type. |
static int |
GENERAL_STRING_TYPE_TAG
Universal tag type. |
static int |
GENERALIZED_TIME_TYPE_TAG
Universal tag type. |
static int |
GRAPHIC_STRING_TYPE_TAG
Universal tag type. |
static int |
IA5_STRING_TYPE_TAG
Universal tag type. |
static int |
INTEGER_TYPE_TAG
Universal tag type. |
static int |
NULL_TYPE_TAG
Universal tag type. |
static int |
NUMERIC_STRING_TYPE_TAG
Universal tag type. |
static int |
OBJECT_DESCRIPTOR_TYPE_TAG
Universal tag type. |
static int |
OBJECT_IDENTIFIER_TYPE_TAG
Universal tag type. |
static int |
OCTET_STRING_TYPE_TAG
Universal tag type. |
static int |
PRINTABLE_STRING_TYPE_TAG
Universal tag type. |
static int |
PRIVATE_CLASS
Private tag class. |
static int |
REAL_TYPE_TAG
Universal tag type. |
static int |
SEQUENCE_TYPE_TAG
Universal tag type. |
static int |
SET_TYPE_TAG
Universal tag type. |
static int |
T61_STRING_TYPE_TAG
Universal tag type. |
static int |
UNIVERSAL_CLASS
Universal tag class. |
static int |
UNIVERSAL_STRING_TYPE_TAG
Universal tag type. |
static int |
UTC_TIME_TYPE_TAG
Universal tag type. |
static int |
UTF8_STRING_TYPE_TAG
Universal tag type. |
static int |
VISIBLE_STRING_TYPE_TAG
Universal tag type. |
| Constructor Summary | |
|---|---|
BERTLVObject(int tag,
Object value)
Constructs a new TLV object with tag tag containing data
value. |
|
BERTLVObject(int tag,
Object value,
boolean interpretValue)
Constructs a new TLV object with tag tag containing data
value. |
|
| Method Summary | |
|---|---|
void |
addSubObject(BERTLVObject object)
Adds object as subobject of |
BERTLVObject |
getChildByIndex(int index)
Returns the indexed child (starting from 0) or null otherwise. |
byte[] |
getEncoded()
This object, including tag and length, as byte array. |
static BERTLVObject |
getInstance(InputStream in)
|
int |
getLength()
|
static byte[] |
getLengthAsBytes(int length)
The length bytes of this object. |
static int |
getLengthLength(int length)
|
BERTLVObject |
getSubObject(int tag)
Gets the first sub-object (including this object) whose tag equals tag. |
BERTLVObject |
getSubObject(int[] tagPath,
int offset,
int length)
Gets the first sub-object (including this object) following the tags in tagPath. |
int |
getTag()
|
static byte[] |
getTagAsBytes(int tag)
The tag bytes of this object. |
static int |
getTagLength(int tag)
|
Object |
getValue()
The encoded value. |
void |
reconstructLength()
Reconstructs the length of the encoded value. |
String |
toString()
A textual (nested tree-like) representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int UNIVERSAL_CLASS
public static final int APPLICATION_CLASS
public static final int CONTEXT_SPECIFIC_CLASS
public static final int PRIVATE_CLASS
public static final int BOOLEAN_TYPE_TAG
public static final int INTEGER_TYPE_TAG
public static final int BIT_STRING_TYPE_TAG
public static final int OCTET_STRING_TYPE_TAG
public static final int NULL_TYPE_TAG
public static final int OBJECT_IDENTIFIER_TYPE_TAG
public static final int OBJECT_DESCRIPTOR_TYPE_TAG
public static final int EXTERNAL_TYPE_TAG
public static final int REAL_TYPE_TAG
public static final int ENUMERATED_TYPE_TAG
public static final int EMBEDDED_PDV_TYPE_TAG
public static final int UTF8_STRING_TYPE_TAG
public static final int SEQUENCE_TYPE_TAG
public static final int SET_TYPE_TAG
public static final int NUMERIC_STRING_TYPE_TAG
public static final int PRINTABLE_STRING_TYPE_TAG
public static final int T61_STRING_TYPE_TAG
public static final int IA5_STRING_TYPE_TAG
public static final int UTC_TIME_TYPE_TAG
public static final int GENERALIZED_TIME_TYPE_TAG
public static final int GRAPHIC_STRING_TYPE_TAG
public static final int VISIBLE_STRING_TYPE_TAG
public static final int GENERAL_STRING_TYPE_TAG
public static final int UNIVERSAL_STRING_TYPE_TAG
public static final int BMP_STRING_TYPE_TAG
| Constructor Detail |
|---|
public BERTLVObject(int tag,
Object value)
tag containing data
value.
tag - tag of TLV objectvalue - data of TLV object
IOException - if something goes wrong.
public BERTLVObject(int tag,
Object value,
boolean interpretValue)
tag containing data
value.
tag - tag of TLV objectvalue - data of TLV objectinterpretValue - whether the embedded byte[] values should be
interpreted/parsed. Some ASN1 streams don't like that :(
IOException - if something goes wrong.| Method Detail |
|---|
public static BERTLVObject getInstance(InputStream in)
throws IOException
IOExceptionpublic void addSubObject(BERTLVObject object)
object as subobject of this TLV object when
this is not a primitive object.
- Parameters:
object - to add as a subobject.
public int getTag()
public void reconstructLength()
public int getLength()
public Object getValue()
public byte[] getEncoded()
public BERTLVObject getSubObject(int tag)
tag.
tag - the tag to search for
public BERTLVObject getSubObject(int[] tagPath,
int offset,
int length)
tagPath - the path to followoffset - in the tagPathlength - of the tagPath
public BERTLVObject getChildByIndex(int index)
index -
public String toString()
toString in class ObjectObject.toString()public static int getTagLength(int tag)
public static int getLengthLength(int length)
public static byte[] getTagAsBytes(int tag)
public static byte[] getLengthAsBytes(int length)
|
JMRTD 0.4.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||