public abstract class CVCObject extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
CVC_VERSION |
static String |
NEWLINE |
| Constructor and Description |
|---|
CVCObject(CVCTagEnum tag)
Constructor taking a tag
|
| Modifier and Type | Method and Description |
|---|---|
protected static int |
decodeLength(DataInputStream in)
Reads and decodes a DER-encoded length value
|
protected abstract int |
encode(DataOutputStream out)
Writes this object as a DER-encoded byte array to 'out'
|
protected static byte[] |
encodeLength(int lenValue)
DER-encodes field length according to ITU-T X.690.
|
String |
getAsText()
Same as getAsText("", true).
|
String |
getAsText(boolean showTagNo)
Same as getAsText("", boolean).
|
String |
getAsText(String tab)
Same as getAsText(String, true).
|
String |
getAsText(String tab,
boolean showTagNo)
Creates a textual representation of this object's tag.
|
AbstractSequence |
getParent()
Returns parent, that is, the AbstractSequence that contains this object (if any)
|
CVCTagEnum |
getTag()
Returns the tag
|
void |
setParent(AbstractSequence parent)
Sets the parent
|
protected static byte[] |
toByteArray(Integer intVal)
Converts an Integer to a trimmed byte array.
|
protected static byte[] |
toByteArray(Long longVal)
Converts a Long to a trimmed byte array.
|
protected static byte[] |
trimByteArray(byte[] data)
Trims a byte array meaning that leading bytes containing zeros have been removed.
|
public static final int CVC_VERSION
public static final String NEWLINE
public CVCObject(CVCTagEnum tag)
tag - public CVCTagEnum getTag()
public AbstractSequence getParent()
public void setParent(AbstractSequence parent)
parent - protected abstract int encode(DataOutputStream out) throws IOException
IOExceptionprotected static byte[] encodeLength(int lenValue)
lenValue - protected static int decodeLength(DataInputStream in) throws IOException
in - IOExceptionprotected static byte[] toByteArray(Integer intVal)
intVal - trimByteArray(byte[])protected static byte[] toByteArray(Long longVal)
longVal - trimByteArray(byte[])protected static byte[] trimByteArray(byte[] data)
data - public String getAsText()
public String getAsText(boolean showTagNo)
showTagNo - public String getAsText(String tab)
tab - public String getAsText(String tab, boolean showTagNo)
tab - supply some whitespace if indentation is wantedshowTagNo - if 'true' then the hex tag value is printed alsoCopyright © 2017. All rights reserved.