|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.crypto.asn1.ASN1InputByteArray
public final class ASN1InputByteArray
A parser which parses bytes according to the ASN.1 Distinguished Encoding Rules (DER) format specification. Note that BER is also supported here.
Note: This is parses data in the same way that ASN1InputStream does. The difference is that this class acts on byte arrays, rather than input streams, and is less oject intensive. Hence, this class should be used instead of ASN1InputStream whenever possible. The only time you would want to use ASN1InputStream over ASN1InputByteArray is when you wish to be looking at multiple positions in the stream at once ( such as if you want to look at two sequences, within the same structure, at the same time.
Note that exception caching is omitted for clarity.
Test ::= SEQUENCE { myNumber INTEGER, myArray OCTET_STRING }// Declarations of variables which will hold the values from the Test fields int myNumber; byte[] myArray; // The input is assumed to be in the byte array buffer byte[] buffer = ...; // Create an ASN.1 input stream (which uses DER encoding) ASN1InputByteArray asn1Input = new ASN1InputByteArray( buffer ); // Read the beginning of an ASN.1 sequence asn1Input.readSequence(); // Read an integer value from the input stream myNumber = asn1Input.readInteger(); // Read the octet string myArray = asn1Input.readOctetString(); // The value of the ASN.1 type "Test" is now stored in myNumber and myArray
ASN1InputStream
Constructor Summary | ||
---|---|---|
|
ASN1InputByteArray(byte[] buffer)
Creates an ASN1InputByteArray using buffer as the data. |
|
|
ASN1InputByteArray(byte[] buffer,
int offset)
Creates an ASN1InputByteArray using buffer as the data. |
Method Summary | ||
---|---|---|
|
byte[] |
getBuffer()
Returns a reference to the underlying buffer. |
|
int |
getEndPosition()
Returns the end position of the ASN.1 field being read. |
|
int |
getFieldEndPosition()
Returns an offset representing the start position of the next field to be read, not the current one. |
|
int |
getStartPosition()
Returns the current position inside of the ASN.1 field being read. |
|
boolean |
isNextTagApplicationSpecific()
Returns true if the next tag indicates application-specific. |
|
boolean |
isNextTagContextSpecific()
Returns true if the next tag indicates context-specific. |
|
boolean |
isNextTagPrivate()
Returns true if the next tag indicates private-use. |
|
boolean |
isNextTagUniversal()
Returns true if the next tag indicates Universal. |
|
int |
peekNextTag()
Returns the next tag value from the stream (without any flags). |
|
String |
readBMPString()
Reads a BMP string in from the ASN1 input. |
|
String |
readBMPString(int tagType,
int tag)
Reads a BMP string in from the ASN1 input with tagging. |
|
String |
readBMPString(int tagType,
int tag,
int clsFlags)
Reads a BMP string in from the ASN1 input with tagging. |
|
String |
readBMPString(int tagType,
int tag,
int clsFlags,
String defaultValue)
Reads a BMP string in from the ASN1 input with tagging. |
|
String |
readBMPString(int tagType,
int tag,
String defaultValue)
Reads a BMP string in from the ASN1 input with tagging. |
|
ASN1BitSet |
readBitString()
Reads a bit string in from the ASN1 input. |
|
ASN1BitSet |
readBitString(int tagType,
int tag)
Reads a bit string in from the ASN1 input with tagging. |
|
ASN1BitSet |
readBitString(int tagType,
int tag,
byte[] defaultValue)
Reads a bit string in from the ASN1 input with tagging. |
|
ASN1BitSet |
readBitString(int tagType,
int tag,
int clsFlags)
Reads a bit string in from the ASN1 input with tagging. |
|
ASN1BitSet |
readBitString(int tagType,
int tag,
int clsFlags,
byte[] defaultValue)
Reads a bit string in from the ASN1 input with tagging. |
|
boolean |
readBoolean()
Reads a boolean in from the ASN1 input. |
|
boolean |
readBoolean(int tagType,
int tag)
Reads a boolean in from the ASN1 input with tagging. |
|
boolean |
readBoolean(int tagType,
int tag,
boolean defaultValue)
Reads a boolean in from the ASN1 input with tagging. |
|
boolean |
readBoolean(int tagType,
int tag,
int clsFlags)
Reads a boolean in from the ASN1 input with tagging. |
|
boolean |
readBoolean(int tagType,
int tag,
int clsFlags,
boolean defaultValue)
Reads a boolean in from the ASN1 input with tagging. |
|
int |
readEnumerated()
Reads an enumerated integer in from the ASN1 input. |
|
int |
readEnumerated(int tagType,
int tag)
Reads an enumerated integer in from the ASN1 input with tagging. |
|
int |
readEnumerated(int tagType,
int tag,
int defaultValue)
Reads an enumerated integer in from the ASN1 input with tagging. |
|
int |
readEnumerated(int tagType,
int tag,
int clsFlags,
int defaultValue)
Reads an enumerated integer in from the ASN1 input with tagging. |
|
byte[] |
readFieldAsByteArray()
Returns the current field as a byte array. |
|
long |
readGeneralizedTime()
Returns an ASN.1 explicit time object from the input. |
|
long |
readGeneralizedTime(int tagType,
int tag)
Returns an ASN.1 explicit time object from the input. |
|
long |
readGeneralizedTime(int tagType,
int tag,
int clsFlags)
Returns an ASN.1 explicit time object from the input. |
|
long |
readGeneralizedTime(int tagType,
int tag,
int clsFlags,
long defaultValue)
Returns an ASN.1 explicit time object from the input. |
|
long |
readGeneralizedTime(int tagType,
int tag,
long defaultValue)
Returns an ASN.1 explicit time object from the input. |
|
String |
readIA5String()
Reads an IA5 string in from the ASN1 input. |
|
String |
readIA5String(int tagType,
int tag)
Reads an IA5 string in from the ASN1 input with tagging. |
|
String |
readIA5String(int tagType,
int tag,
int clsFlags)
Reads an IA5 string in from the ASN1 input with tagging. |
|
String |
readIA5String(int tagType,
int tag,
int clsFlags,
String defaultValue)
Reads an IA5 string in from the ASN1 input with tagging. |
|
String |
readIA5String(int tagType,
int tag,
String defaultValue)
Reads an IA5 string in from the ASN1 input with tagging. |
|
int |
readInteger()
Reads an integer in from the ASN1 input. |
|
int |
readInteger(int tagType,
int tag)
Reads an integer in from the ASN1 input with tagging. |
|
int |
readInteger(int tagType,
int tag,
int defaultValue)
Reads an integer in from the ASN1 input with tagging. |
|
int |
readInteger(int tagType,
int tag,
int clsFlags,
int defaultValue)
Reads an integer in from the ASN1 input with tagging. |
|
byte[] |
readIntegerAsByteArray()
Reads an integer (as a byte array) in from the ASN1 input. |
|
byte[] |
readIntegerAsByteArray(int tagType,
int tag)
Reads an integer (as a byte array) in from the ASN1 input with tagging. |
|
byte[] |
readIntegerAsByteArray(int tagType,
int tag,
byte[] defaultValue)
Reads an integer (as a byte array) in from the ASN1 input with tagging. |
|
byte[] |
readIntegerAsByteArray(int tagType,
int tag,
int clsFlags)
Reads an integer (as a byte array) in from the ASN1 input with tagging. |
|
byte[] |
readIntegerAsByteArray(int tagType,
int tag,
int clsFlags,
byte[] defaultValue)
Reads an integer (as a byte array) in from the ASN1 input with tagging. |
|
boolean |
readNull()
Reads a null in from the ASN1 input. |
|
boolean |
readNull(int tagType,
int tag)
Reads a null in from the ASN1 input with tagging. |
|
boolean |
readNull(int tagType,
int tag,
boolean defaultValue)
Reads a null in from the ASN1 input with tagging. |
|
boolean |
readNull(int tagType,
int tag,
int clsFlags)
Reads a null in from the ASN1 input with tagging. |
|
boolean |
readNull(int tagType,
int tag,
int clsFlags,
boolean defaultValue)
Reads a null in from the ASN1 input with tagging. |
|
OID |
readOID()
Returns an ASN.1 Object Identifier (OID) from the input with tagging. |
|
OID |
readOID(int tagType,
int tag)
Returns an ASN.1 Object Identifier (OID) from the input with tagging. |
|
OID |
readOID(int tagType,
int tag,
int clsFlags)
Returns an ASN.1 Object Identifier (OID) from the input with tagging. |
|
OID |
readOID(int tagType,
int tag,
int clsFlags,
OID defaultValue)
Returns an ASN.1 Object Identifier (OID) from the input with tagging. |
|
OID |
readOID(int tagType,
int tag,
OID defaultValue)
Returns an ASN.1 Object Identifier (OID) from the input with tagging. |
|
byte[] |
readOctetString()
Reads an octet string in from the ASN1 input. |
|
byte[] |
readOctetString(int tagType,
int tag)
Reads an octet string in from the ASN1 input with tagging. |
|
byte[] |
readOctetString(int tagType,
int tag,
byte[] defaultValue)
Reads an octet string in from the ASN1 input with tagging. |
|
byte[] |
readOctetString(int tagType,
int tag,
int clsFlags)
Reads an octet string in from the ASN1 input with tagging. |
|
byte[] |
readOctetString(int tagType,
int tag,
int clsFlags,
byte[] defaultValue)
Reads an octet string in from the ASN1 input with tagging. |
|
String |
readPrintableString()
Reads a PRINTABLE string in from the ASN1 input. |
|
String |
readPrintableString(int tagType,
int tag)
Reads a PRINTABLE string in from the ASN1 input with tagging. |
|
String |
readPrintableString(int tagType,
int tag,
int clsFlags)
Reads a PRINTABLE string in from the ASN1 input with tagging. |
|
String |
readPrintableString(int tagType,
int tag,
int clsFlags,
String defaultValue)
Reads a PRINTABLE string in from the ASN1 input with tagging. |
|
String |
readPrintableString(int tagType,
int tag,
String defaultValue)
Reads a PRINTABLE string in from the ASN1 input with tagging. |
|
void |
readSequence()
Reads a sequence in from the ASN1 input. |
|
void |
readSequence(int tagType,
int tag)
Reads a sequence in from the ASN1 input with tagging. |
|
void |
readSequence(int tagType,
int tag,
int clsFlags)
Reads a sequence in from the ASN1 input with tagging. |
|
void |
readSet()
Reads a set in from the ASN1 input. |
|
void |
readSet(int tagType,
int tag)
Reads a set in from the ASN1 input with tagging. |
|
void |
readSet(int tagType,
int tag,
int clsFlags)
Reads a set in from the ASN1 input with tagging. |
|
String |
readT61String()
Reads a T61 string in from the ASN1 input. |
|
String |
readT61String(int tagType,
int tag)
Reads a T61 string in from the ASN1 input with tagging. |
|
String |
readT61String(int tagType,
int tag,
int clsFlags)
Reads a T61 string in from the ASN1 input with tagging. |
|
String |
readT61String(int tagType,
int tag,
int clsFlags,
String defaultValue)
Reads a T61 string in from the ASN1 input with tagging. |
|
String |
readT61String(int tagType,
int tag,
String defaultValue)
Reads a T61 string in from the ASN1 input with tagging. |
|
long |
readUTCTime()
Returns an ASN.1 explicit time object from the input. |
|
long |
readUTCTime(int tagType,
int tag)
Returns an ASN.1 explicit time object from the input. |
|
long |
readUTCTime(int tagType,
int tag,
int clsFlags)
Returns an ASN.1 explicit time object from the input. |
|
long |
readUTCTime(int tagType,
int tag,
int clsFlags,
long defaultValue)
Returns an ASN.1 explicit time object from the input. |
|
long |
readUTCTime(int tagType,
int tag,
long defaultValue)
Returns an ASN.1 explicit time object from the input. |
|
String |
readUTF8String()
Reads a UTF8 string in from the ASN1 input. |
|
String |
readUTF8String(int tagType,
int tag)
Reads a UTF8 string in from the ASN1 input with tagging. |
|
String |
readUTF8String(int tagType,
int tag,
int clsFlags)
Reads a UTF8 string in from the ASN1 input with tagging. |
|
String |
readUTF8String(int tagType,
int tag,
int clsFlags,
String defaultValue)
Reads a UTF8 string in from the ASN1 input with tagging. |
|
String |
readUTF8String(int tagType,
int tag,
String defaultValue)
Reads a UTF8 string in from the ASN1 input with tagging. |
|
void |
setEndPosition(int endPosition)
Set the end position inside of the buffer. |
|
void |
setStartPosition(int startPosition)
Set the start position inside of the buffer. |
|
void |
skipField()
Skips the current field. |
|
void |
skipField(int tag)
Skips the current field that has the specified tag. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ASN1InputByteArray(byte[] buffer)
ASN1InputByteArray
using buffer
as the data.
buffer
- A byte array to read data from.public ASN1InputByteArray(byte[] buffer, int offset)
ASN1InputByteArray
using buffer
as the data.
buffer
- A byte array to read data from.offset
- The offset into the byte array to start reading.Method Detail |
---|
public byte[] getBuffer()
public int getStartPosition()
ASN1InputByteArray.setStartPosition(int)
public int getEndPosition()
ASN1InputByteArray.setEndPosition(int)
public void setStartPosition(int startPosition)
startPosition
- The start position to use.ASN1InputByteArray.getStartPosition()
public void setEndPosition(int endPosition)
endPosition
- The end position to use.ASN1InputByteArray.getEndPosition()
public boolean isNextTagUniversal() throws EOFException, IOException
Universal means that the assigned tag is recognized outside the scope of the current construction.
EOFException
- Thrown when the end of the stream is reached.
IOException
- Thrown in the case of an I/O error.public boolean isNextTagApplicationSpecific() throws EOFException, IOException
Application-specific means that the assigned tag is specific to the scope of the current application.
EOFException
- Thrown when the end of the stream is reached.
IOException
- Thrown in the case of an I/O error.public boolean isNextTagContextSpecific() throws EOFException, IOException
Context-specific means that the assigned tag is specific to the constructed type you find it in.
EOFException
- Thrown when the end of the stream is reached.
IOException
- Thrown in the case of an I/O error.public boolean isNextTagPrivate() throws EOFException, IOException
EOFException
- Thrown when the end of the stream is reached.
IOException
- Thrown in the case of an I/O error.public int peekNextTag()
This call can be used for ASN.1 CHOICE or ANY types.
public void readSequence() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the sequence could not be found or was
incorrectly formatted.public void readSequence(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT,
TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the sequence was incorrectly formatted.public void readSequence(int tagType, int tag, int clsFlags) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT,
TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the sequence was incorrectly formatted.public void readSet() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the set was incorrectly formatted.public void readSet(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the set was incorrectly formatted.public void readSet(int tagType, int tag, int clsFlags) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the set was incorrectly formatted.public boolean readBoolean() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public boolean readBoolean(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public boolean readBoolean(int tagType, int tag, boolean defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public boolean readBoolean(int tagType, int tag, int clsFlags) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public boolean readBoolean(int tagType, int tag, int clsFlags, boolean defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public boolean readNull() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the null was incorrectly formatted.public boolean readNull(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the null was incorrectly formatted.public boolean readNull(int tagType, int tag, boolean defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the null was incorrectly formatted.public boolean readNull(int tagType, int tag, int clsFlags) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the null was incorrectly formatted.public boolean readNull(int tagType, int tag, int clsFlags, boolean defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the null was incorrectly formatted.public int readInteger() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public int readInteger(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public int readInteger(int tagType, int tag, int defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public int readInteger(int tagType, int tag, int clsFlags, int defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public int readEnumerated() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public int readEnumerated(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public int readEnumerated(int tagType, int tag, int defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public int readEnumerated(int tagType, int tag, int clsFlags, int defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public byte[] readIntegerAsByteArray() throws ASN1EncodingException
Note that if the integer read was negative, it is up to the caller to interpret it as such. We cannot do that interpretation for the user since we are just returning a byte array which has no sign associated with it.
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public byte[] readIntegerAsByteArray(int tagType, int tag) throws ASN1EncodingException
Note that if the integer read was negative, it is up to the caller to interpret it as such. We cannot do that interpretation for the user since we are just returning a byte array which has no sign associated with it.
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public byte[] readIntegerAsByteArray(int tagType, int tag, byte[] defaultValue) throws ASN1EncodingException
Note that if the integer read was negative, it is up to the caller to interpret it as such. We cannot do that interpretation for the user since we are just returning a byte array which has no sign associated with it.
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public byte[] readIntegerAsByteArray(int tagType, int tag, int clsFlags) throws ASN1EncodingException
Note that if the integer read was negative, it is up to the caller to interpret it as such. We cannot do that interpretation for the user since we are just returning a byte array which has no sign associated with it.
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public byte[] readIntegerAsByteArray(int tagType, int tag, int clsFlags, byte[] defaultValue) throws ASN1EncodingException
Note that if the integer read was negative, it is up to the caller to interpret it as such. We cannot do that interpretation for the user since we are just returning a byte array which has no sign associated with it.
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the boolean was incorrectly formatted.public String readPrintableString() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readPrintableString(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readPrintableString(int tagType, int tag, String defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readPrintableString(int tagType, int tag, int clsFlags) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readPrintableString(int tagType, int tag, int clsFlags, String defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readIA5String() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readIA5String(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readIA5String(int tagType, int tag, String defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readIA5String(int tagType, int tag, int clsFlags) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readIA5String(int tagType, int tag, int clsFlags, String defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readT61String() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readT61String(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readT61String(int tagType, int tag, String defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readT61String(int tagType, int tag, int clsFlags) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readT61String(int tagType, int tag, int clsFlags, String defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readUTF8String() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readUTF8String(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readUTF8String(int tagType, int tag, String defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readUTF8String(int tagType, int tag, int clsFlags) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readUTF8String(int tagType, int tag, int clsFlags, String defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readBMPString() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readBMPString(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readBMPString(int tagType, int tag, String defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readBMPString(int tagType, int tag, int clsFlags) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public String readBMPString(int tagType, int tag, int clsFlags, String defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public OID readOID() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public OID readOID(int tagType, int tag) throws ASN1EncodingException
tagType
- Whether this is DERTags.TAG_IMPLICIT, DERTags.TAG_EXPLICIT or DERTags.TAG_NONEtag
- The tag to look for.
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public OID readOID(int tagType, int tag, OID defaultValue) throws ASN1EncodingException
tagType
- Whether this is DERTags.TAG_IMPLICIT, DERTags.TAG_EXPLICIT or DERTags.TAG_NONEtag
- The tag to look for.defaultValue
- A default Value to return if not an oid.
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public OID readOID(int tagType, int tag, int clsFlags) throws ASN1EncodingException
tagType
- Whether this is DERTags.TAG_IMPLICIT, DERTags.TAG_EXPLICIT or DERTags.TAG_NONEtag
- The tag to look for.clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public OID readOID(int tagType, int tag, int clsFlags, OID defaultValue) throws ASN1EncodingException
tagType
- Whether this is DERTags.TAG_IMPLICIT, DERTags.TAG_EXPLICIT or DERTags.TAG_NONEtag
- The tag to look for.clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- A default Value to return if not an oid.
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public long readGeneralizedTime() throws ASN1EncodingException
This handles GENERALIZED time.
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public long readGeneralizedTime(int tagType, int tag) throws ASN1EncodingException
This handles GENERALIZED time.
tagType
- Whether this is DERTags.TAG_IMPLICIT, DERTags.TAG_EXPLICIT or DERTags.TAG_NONE.tag
- The tag to look for
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public long readGeneralizedTime(int tagType, int tag, long defaultValue) throws ASN1EncodingException
This handles GENERALIZED time.
tagType
- Whether this is DERTags.TAG_IMPLICIT, DERTags.TAG_EXPLICIT or DERTags.TAG_NONE.tag
- The tag to look fordefaultValue
- A default Value to return if not a date
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public long readGeneralizedTime(int tagType, int tag, int clsFlags) throws ASN1EncodingException
This handles GENERALIZED time.
tagType
- Whether this is DERTags.TAG_IMPLICIT, DERTags.TAG_EXPLICIT or DERTags.TAG_NONE.tag
- The tag to look forclsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public long readGeneralizedTime(int tagType, int tag, int clsFlags, long defaultValue) throws ASN1EncodingException
This handles GENERALIZED time.
tagType
- Whether this is DERTags.TAG_IMPLICIT, DERTags.TAG_EXPLICIT or DERTags.TAG_NONE.tag
- The tag to look forclsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- A default Value to return if not a date
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public long readUTCTime() throws ASN1EncodingException
This handles UTC time.
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public long readUTCTime(int tagType, int tag) throws ASN1EncodingException
This handles UTC time.
tagType
- Whether this is DERTags.TAG_IMPLICIT, DERTags.TAG_EXPLICIT or DERTags.TAG_NONE.tag
- The tag to look for.
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public long readUTCTime(int tagType, int tag, long defaultValue) throws ASN1EncodingException
This handles UTC time.
tagType
- Whether this is DERTags.TAG_IMPLICIT, DERTags.TAG_EXPLICIT or DERTags.TAG_NONE.tag
- The tag to look for.defaultValue
- A default Value to return if not a date.
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public long readUTCTime(int tagType, int tag, int clsFlags) throws ASN1EncodingException
This handles UTC time.
tagType
- Whether this is DERTags.TAG_IMPLICIT, DERTags.TAG_EXPLICIT or DERTags.TAG_NONE.tag
- The tag to look for.clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public long readUTCTime(int tagType, int tag, int clsFlags, long defaultValue) throws ASN1EncodingException
This handles UTC time.
tagType
- Whether this is DERTags.TAG_IMPLICIT, DERTags.TAG_EXPLICIT or DERTags.TAG_NONE.tag
- The tag to look for.clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- A default Value to return if not a date.
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public ASN1BitSet readBitString() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public ASN1BitSet readBitString(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public ASN1BitSet readBitString(int tagType, int tag, byte[] defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public ASN1BitSet readBitString(int tagType, int tag, int clsFlags) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public ASN1BitSet readBitString(int tagType, int tag, int clsFlags, byte[] defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public byte[] readOctetString() throws ASN1EncodingException
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public byte[] readOctetString(int tagType, int tag) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public byte[] readOctetString(int tagType, int tag, byte[] defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public byte[] readOctetString(int tagType, int tag, int clsFlags) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public byte[] readOctetString(int tagType, int tag, int clsFlags, byte[] defaultValue) throws ASN1EncodingException
tagType
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to look for (ignored if tagging is TAG_NONE).clsFlags
- The class flag to check for ( either DERTags.UNIVERSAL_CLASS_FLAG,
DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )defaultValue
- The value to return if the tag cannot be found.
ASN1EncodingException
- Thrown if the String was incorrectly formatted.public byte[] readFieldAsByteArray() throws ASN1EncodingException
A field consists of a tag, length and data value. Calling this function on an octet string would return a byte array containing the tag of the octet string ( 0x04 ), the length of the octet string, and the contents of the octet string.
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public void skipField() throws ASN1EncodingException
A field consists of a tag, length and data value.
Calling this function on an octet string would skip over the tag of the octet string, the length of the octet string, and the contents of the octet string.
So an example of a field would be { 0x04, 0x02, 0x12, 0x34 } where 0x04 is the octet string tag, 0x02 is the length of the data, and 0x1234 is the data. Skipfield will skip over all 4 bytes.
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public void skipField(int tag) throws ASN1EncodingException
A field consists of a tag, length and data value.
Calling this function on an octet string would skip over the tag of the octet string, the length of the octet string, and the contents of the octet string.
So an example of a field would be { 0x04, 0x02, 0x12, 0x34 } where 0x04 is the octet string tag, 0x02 is the length of the data, and 0x1234 is the data. Skipfield will skip over all 4 bytes.
tag
- An integer representing the field tag.
ASN1EncodingException
- Thrown if the data encountered is not in
the expected format.public int getFieldEndPosition() throws ASN1EncodingException
ASN1EncodingException
- thrown if the data encountered is not in the expected format.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.