SHOW Signed

net.rim.device.api.crypto.asn1
Class ASN1InputByteArray

java.lang.Object
  |
  +--net.rim.device.api.crypto.asn1.ASN1InputByteArray

public final class ASN1InputByteArray
extends Object

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.

Example Usage

The following example inputs a Test type sequence of DER-encoded bytes from a file, in the ASN.1 format:

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) ASN1BitSet 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

Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

Since:
JDE 3.6.0
See Also:
ASN1InputStream

Constructor Summary
 Category: Signed ASN1InputByteArray(byte[] buffer)
          Creates an ASN1InputByteArray using buffer as the data.
 Category: Signed ASN1InputByteArray(byte[] buffer, int offset)
          Creates an ASN1InputByteArray using buffer as the data.
 
Method Summary
 Category: Signed  byte[] getBuffer()
          Returns a reference to the underlying buffer.
 Category: Signed  int getEndPosition()
          Returns the end position of the ASN.1 field being read.
 Category: Signed  int getFieldEndPosition()
          Returns an offset representing the start position of the next field to be read, not the current one.
 Category: Signed  int getStartPosition()
          Returns the current position inside of the ASN.1 field being read.
 Category: Signed  boolean isNextTagApplicationSpecific()
          Returns true if the next tag indicates application-specific.
 Category: Signed  boolean isNextTagContextSpecific()
          Returns true if the next tag indicates context-specific.
 Category: Signed  boolean isNextTagPrivate()
          Returns true if the next tag indicates private-use.
 Category: Signed  boolean isNextTagUniversal()
          Returns true if the next tag indicates Universal.
 Category: Signed  int peekNextTag()
          Returns the next tag value from the stream (without any flags).
 Category: Signed  ASN1BitSet readBitString()
          Reads a bit string in from the ASN1 input.
 Category: Signed  ASN1BitSet readBitString(int tagType, int tag)
          Reads a bit string in from the ASN1 input with tagging.
 Category: Signed  ASN1BitSet readBitString(int tagType, int tag, byte[] defaultValue)
          Reads a bit string in from the ASN1 input with tagging.
 Category: Signed  ASN1BitSet readBitString(int tagType, int tag, int clsFlags)
          Reads a bit string in from the ASN1 input with tagging.
 Category: Signed  ASN1BitSet readBitString(int tagType, int tag, int clsFlags, byte[] defaultValue)
          Reads a bit string in from the ASN1 input with tagging.
 Category: Signed  String readBMPString()
          Reads a BMP string in from the ASN1 input.
 Category: Signed  String readBMPString(int tagType, int tag)
          Reads a BMP string in from the ASN1 input with tagging.
 Category: Signed  String readBMPString(int tagType, int tag, int clsFlags)
          Reads a BMP string in from the ASN1 input with tagging.
 Category: Signed  String readBMPString(int tagType, int tag, int clsFlags, String defaultValue)
          Reads a BMP string in from the ASN1 input with tagging.
 Category: Signed  String readBMPString(int tagType, int tag, String defaultValue)
          Reads a BMP string in from the ASN1 input with tagging.
 Category: Signed  boolean readBoolean()
          Reads a boolean in from the ASN1 input.
 Category: Signed  boolean readBoolean(int tagType, int tag)
          Reads a boolean in from the ASN1 input with tagging.
 Category: Signed  boolean readBoolean(int tagType, int tag, boolean defaultValue)
          Reads a boolean in from the ASN1 input with tagging.
 Category: Signed  boolean readBoolean(int tagType, int tag, int clsFlags)
          Reads a boolean in from the ASN1 input with tagging.
 Category: Signed  boolean readBoolean(int tagType, int tag, int clsFlags, boolean defaultValue)
          Reads a boolean in from the ASN1 input with tagging.
 Category: Signed  int readEnumerated()
          Reads an enumerated integer in from the ASN1 input.
 Category: Signed  int readEnumerated(int tagType, int tag)
          Reads an enumerated integer in from the ASN1 input with tagging.
 Category: Signed  int readEnumerated(int tagType, int tag, int defaultValue)
          Reads an enumerated integer in from the ASN1 input with tagging.
 Category: Signed  int readEnumerated(int tagType, int tag, int clsFlags, int defaultValue)
          Reads an enumerated integer in from the ASN1 input with tagging.
 Category: Signed  byte[] readFieldAsByteArray()
          Returns the current field as a byte array.
 Category: Signed  long readGeneralizedTime()
          Returns an ASN.1 explicit time object from the input.
 Category: Signed  long readGeneralizedTime(int tagType, int tag)
          Returns an ASN.1 explicit time object from the input.
 Category: Signed  long readGeneralizedTime(int tagType, int tag, int clsFlags)
          Returns an ASN.1 explicit time object from the input.
 Category: Signed  long readGeneralizedTime(int tagType, int tag, int clsFlags, long defaultValue)
          Returns an ASN.1 explicit time object from the input.
 Category: Signed  long readGeneralizedTime(int tagType, int tag, long defaultValue)
          Returns an ASN.1 explicit time object from the input.
 Category: Signed  String readIA5String()
          Reads an IA5 string in from the ASN1 input.
 Category: Signed  String readIA5String(int tagType, int tag)
          Reads an IA5 string in from the ASN1 input with tagging.
 Category: Signed  String readIA5String(int tagType, int tag, int clsFlags)
          Reads an IA5 string in from the ASN1 input with tagging.
 Category: Signed  String readIA5String(int tagType, int tag, int clsFlags, String defaultValue)
          Reads an IA5 string in from the ASN1 input with tagging.
 Category: Signed  String readIA5String(int tagType, int tag, String defaultValue)
          Reads an IA5 string in from the ASN1 input with tagging.
 Category: Signed  int readInteger()
          Reads an integer in from the ASN1 input.
 Category: Signed  int readInteger(int tagType, int tag)
          Reads an integer in from the ASN1 input with tagging.
 Category: Signed  int readInteger(int tagType, int tag, int defaultValue)
          Reads an integer in from the ASN1 input with tagging.
 Category: Signed  int readInteger(int tagType, int tag, int clsFlags, int defaultValue)
          Reads an integer in from the ASN1 input with tagging.
 Category: Signed  byte[] readIntegerAsByteArray()
          Reads an integer (as a byte array) in from the ASN1 input.
 Category: Signed  byte[] readIntegerAsByteArray(int tagType, int tag)
          Reads an integer (as a byte array) in from the ASN1 input with tagging.
 Category: Signed  byte[] readIntegerAsByteArray(int tagType, int tag, byte[] defaultValue)
          Reads an integer (as a byte array) in from the ASN1 input with tagging.
 Category: Signed  byte[] readIntegerAsByteArray(int tagType, int tag, int clsFlags)
          Reads an integer (as a byte array) in from the ASN1 input with tagging.
 Category: Signed  byte[] readIntegerAsByteArray(int tagType, int tag, int clsFlags, byte[] defaultValue)
          Reads an integer (as a byte array) in from the ASN1 input with tagging.
 Category: Signed  boolean readNull()
          Reads a null in from the ASN1 input.
 Category: Signed  boolean readNull(int tagType, int tag)
          Reads a null in from the ASN1 input with tagging.
 Category: Signed  boolean readNull(int tagType, int tag, boolean defaultValue)
          Reads a null in from the ASN1 input with tagging.
 Category: Signed  boolean readNull(int tagType, int tag, int clsFlags)
          Reads a null in from the ASN1 input with tagging.
 Category: Signed  boolean readNull(int tagType, int tag, int clsFlags, boolean defaultValue)
          Reads a null in from the ASN1 input with tagging.
 Category: Signed  byte[] readOctetString()
          Reads an octet string in from the ASN1 input.
 Category: Signed  byte[] readOctetString(int tagType, int tag)
          Reads an octet string in from the ASN1 input with tagging.
 Category: Signed  byte[] readOctetString(int tagType, int tag, byte[] defaultValue)
          Reads an octet string in from the ASN1 input with tagging.
 Category: Signed  byte[] readOctetString(int tagType, int tag, int clsFlags)
          Reads an octet string in from the ASN1 input with tagging.
 Category: Signed  byte[] readOctetString(int tagType, int tag, int clsFlags, byte[] defaultValue)
          Reads an octet string in from the ASN1 input with tagging.
 Category: Signed  OID readOID()
          Returns an ASN.1 Object Identifier (OID) from the input with tagging.
 Category: Signed  OID readOID(int tagType, int tag)
          Returns an ASN.1 Object Identifier (OID) from the input with tagging.
 Category: Signed  OID readOID(int tagType, int tag, int clsFlags)
          Returns an ASN.1 Object Identifier (OID) from the input with tagging.
 Category: Signed  OID readOID(int tagType, int tag, int clsFlags, OID defaultValue)
          Returns an ASN.1 Object Identifier (OID) from the input with tagging.
 Category: Signed  OID readOID(int tagType, int tag, OID defaultValue)
          Returns an ASN.1 Object Identifier (OID) from the input with tagging.
 Category: Signed  String readPrintableString()
          Reads a PRINTABLE string in from the ASN1 input.
 Category: Signed  String readPrintableString(int tagType, int tag)
          Reads a PRINTABLE string in from the ASN1 input with tagging.
 Category: Signed  String readPrintableString(int tagType, int tag, int clsFlags)
          Reads a PRINTABLE string in from the ASN1 input with tagging.
 Category: Signed  String readPrintableString(int tagType, int tag, int clsFlags, String defaultValue)
          Reads a PRINTABLE string in from the ASN1 input with tagging.
 Category: Signed  String readPrintableString(int tagType, int tag, String defaultValue)
          Reads a PRINTABLE string in from the ASN1 input with tagging.
 Category: Signed  void readSequence()
          Reads a sequence in from the ASN1 input.
 Category: Signed  void readSequence(int tagType, int tag)
          Reads a sequence in from the ASN1 input with tagging.
 Category: Signed  void readSequence(int tagType, int tag, int clsFlags)
          Reads a sequence in from the ASN1 input with tagging.
 Category: Signed  void readSet()
          Reads a set in from the ASN1 input.
 Category: Signed  void readSet(int tagType, int tag)
          Reads a set in from the ASN1 input with tagging.
 Category: Signed  void readSet(int tagType, int tag, int clsFlags)
          Reads a set in from the ASN1 input with tagging.
 Category: Signed  String readT61String()
          Reads a T61 string in from the ASN1 input.
 Category: Signed  String readT61String(int tagType, int tag)
          Reads a T61 string in from the ASN1 input with tagging.
 Category: Signed  String readT61String(int tagType, int tag, int clsFlags)
          Reads a T61 string in from the ASN1 input with tagging.
 Category: Signed  String readT61String(int tagType, int tag, int clsFlags, String defaultValue)
          Reads a T61 string in from the ASN1 input with tagging.
 Category: Signed  String readT61String(int tagType, int tag, String defaultValue)
          Reads a T61 string in from the ASN1 input with tagging.
 Category: Signed  long readUTCTime()
          Returns an ASN.1 explicit time object from the input.
 Category: Signed  long readUTCTime(int tagType, int tag)
          Returns an ASN.1 explicit time object from the input.
 Category: Signed  long readUTCTime(int tagType, int tag, int clsFlags)
          Returns an ASN.1 explicit time object from the input.
 Category: Signed  long readUTCTime(int tagType, int tag, int clsFlags, long defaultValue)
          Returns an ASN.1 explicit time object from the input.
 Category: Signed  long readUTCTime(int tagType, int tag, long defaultValue)
          Returns an ASN.1 explicit time object from the input.
 Category: Signed  String readUTF8String()
          Reads a UTF8 string in from the ASN1 input.
 Category: Signed  String readUTF8String(int tagType, int tag)
          Reads a UTF8 string in from the ASN1 input with tagging.
 Category: Signed  String readUTF8String(int tagType, int tag, int clsFlags)
          Reads a UTF8 string in from the ASN1 input with tagging.
 Category: Signed  String readUTF8String(int tagType, int tag, int clsFlags, String defaultValue)
          Reads a UTF8 string in from the ASN1 input with tagging.
 Category: Signed  String readUTF8String(int tagType, int tag, String defaultValue)
          Reads a UTF8 string in from the ASN1 input with tagging.
 Category: Signed  void setEndPosition(int endPosition)
          Set the end position inside of the buffer.
 Category: Signed  void setStartPosition(int startPosition)
          Set the start position inside of the buffer.
 Category: Signed  void skipField()
          Skips the current field.
 Category: Signed  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

ASN1InputByteArray

public ASN1InputByteArray(byte[] buffer)
Creates an ASN1InputByteArray using buffer as the data.

Parameters:
buffer - A byte array to read data from.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

ASN1InputByteArray

public ASN1InputByteArray(byte[] buffer,
                          int offset)
Creates an ASN1InputByteArray using buffer as the data.

Parameters:
buffer - A byte array to read data from.
offset - The offset into the byte array to start reading.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Method Detail

getBuffer

public byte[] getBuffer()
Returns a reference to the underlying buffer.

Returns:
A reference to the underlying buffer.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getStartPosition

public int getStartPosition()
Returns the current position inside of the ASN.1 field being read.

Returns:
The offset into the buffer where we are reading from.
Since:
JDE 3.6.0
See Also:
setStartPosition(int)
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getEndPosition

public int getEndPosition()
Returns the end position of the ASN.1 field being read.

Returns:
The offset into the buffer which represents the end of the field being read.
Since:
JDE 3.6.0
See Also:
setEndPosition(int)
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

setStartPosition

public void setStartPosition(int startPosition)
Set the start position inside of the buffer. If the new startPosition is larger than the current endPosition, it will be updated to equal startPosition.

Parameters:
startPosition - The start position to use.
Since:
JDE 4.0.0
See Also:
getStartPosition()
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

setEndPosition

public void setEndPosition(int endPosition)
Set the end position inside of the buffer. If the specified endPosition is less than the current startPosition, endPosition will be set to the startPosition.

Parameters:
endPosition - The end position to use.
Since:
JDE 4.0.0
See Also:
getEndPosition()
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

isNextTagUniversal

public boolean isNextTagUniversal()
                           throws EOFException,
                                  IOException
Returns true if the next tag indicates Universal.

Universal means that the assigned tag is recognized outside the scope of the current construction.

Returns:
A boolean that indicates the type of the next tag.
Throws:
EOFException - Thrown when the end of the stream is reached.
IOException - Thrown in the case of an I/O error.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

isNextTagApplicationSpecific

public boolean isNextTagApplicationSpecific()
                                     throws EOFException,
                                            IOException
Returns true if the next tag indicates application-specific.

Application-specific means that the assigned tag is specific to the scope of the current application.

Returns:
A boolean that determines if the next tag is application specific.
Throws:
EOFException - Thrown when the end of the stream is reached.
IOException - Thrown in the case of an I/O error.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

isNextTagContextSpecific

public boolean isNextTagContextSpecific()
                                 throws EOFException,
                                        IOException
Returns true if the next tag indicates context-specific.

Context-specific means that the assigned tag is specific to the constructed type you find it in.

Returns:
A boolean that determines if the next tag is context specific.
Throws:
EOFException - Thrown when the end of the stream is reached.
IOException - Thrown in the case of an I/O error.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

isNextTagPrivate

public boolean isNextTagPrivate()
                         throws EOFException,
                                IOException
Returns true if the next tag indicates private-use. Private-use means that the assigned tag is private.

Returns:
A boolean that represents the type of the next tag.
Throws:
EOFException - Thrown when the end of the stream is reached.
IOException - Thrown in the case of an I/O error.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

peekNextTag

public int peekNextTag()
Returns the next tag value from the stream (without any flags). I.e. If the full byte was 0x82 then peekNextTag() will strip off the 0x80 ( the context specific flag ) and leave the 0x02 behind ( which indicates an integer ).

This call can be used for ASN.1 CHOICE or ANY types.

Returns:
The next tag to be read or -1 if at the end of the buffer
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readSequence

public void readSequence()
                  throws ASN1EncodingException
Reads a sequence in from the ASN1 input.

Throws:
ASN1EncodingException - Thrown if the sequence could not be found or was incorrectly formatted.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readSequence

public void readSequence(int tagType,
                         int tag)
                  throws ASN1EncodingException
Reads a sequence in from the ASN1 input with tagging.

Parameters:
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).
Throws:
ASN1EncodingException - Thrown if the sequence was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readSequence

public void readSequence(int tagType,
                         int tag,
                         int clsFlags)
                  throws ASN1EncodingException
Reads a sequence in from the ASN1 input with tagging.

Parameters:
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 )
Throws:
ASN1EncodingException - Thrown if the sequence was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readSet

public void readSet()
             throws ASN1EncodingException
Reads a set in from the ASN1 input.

Throws:
ASN1EncodingException - Thrown if the set was incorrectly formatted.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readSet

public void readSet(int tagType,
                    int tag)
             throws ASN1EncodingException
Reads a set in from the ASN1 input with tagging.

Parameters:
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).
Throws:
ASN1EncodingException - Thrown if the set was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readSet

public void readSet(int tagType,
                    int tag,
                    int clsFlags)
             throws ASN1EncodingException
Reads a set in from the ASN1 input with tagging.

Parameters:
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 )
Throws:
ASN1EncodingException - Thrown if the set was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readBoolean

public boolean readBoolean()
                    throws ASN1EncodingException
Reads a boolean in from the ASN1 input.

Returns:
The boolean value.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readBoolean

public boolean readBoolean(int tagType,
                           int tag)
                    throws ASN1EncodingException
Reads a boolean in from the ASN1 input with tagging.

Parameters:
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).
Returns:
The boolean value.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readBoolean

public boolean readBoolean(int tagType,
                           int tag,
                           boolean defaultValue)
                    throws ASN1EncodingException
Reads a boolean in from the ASN1 input with tagging.

Parameters:
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.
Returns:
The boolean value, or default value if the expected tag could not be found.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readBoolean

public boolean readBoolean(int tagType,
                           int tag,
                           int clsFlags)
                    throws ASN1EncodingException
Reads a boolean in from the ASN1 input with tagging.

Parameters:
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 )
Returns:
The boolean value, or default value if the expected tag could not be found.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readBoolean

public boolean readBoolean(int tagType,
                           int tag,
                           int clsFlags,
                           boolean defaultValue)
                    throws ASN1EncodingException
Reads a boolean in from the ASN1 input with tagging.

Parameters:
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.
Returns:
The boolean value, or default value if the expected tag could not be found.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readNull

public boolean readNull()
                 throws ASN1EncodingException
Reads a null in from the ASN1 input.

Returns:
True if the null was found, false otherwise.
Throws:
ASN1EncodingException - Thrown if the null was incorrectly formatted.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readNull

public boolean readNull(int tagType,
                        int tag)
                 throws ASN1EncodingException
Reads a null in from the ASN1 input with tagging.

Parameters:
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).
Returns:
True if the null was found, false otherwise.
Throws:
ASN1EncodingException - Thrown if the null was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readNull

public boolean readNull(int tagType,
                        int tag,
                        boolean defaultValue)
                 throws ASN1EncodingException
Reads a null in from the ASN1 input with tagging.

Parameters:
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.
Returns:
True if the null was found, false otherwise.
Throws:
ASN1EncodingException - Thrown if the null was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readNull

public boolean readNull(int tagType,
                        int tag,
                        int clsFlags)
                 throws ASN1EncodingException
Reads a null in from the ASN1 input with tagging.

Parameters:
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 )
Returns:
True if the null was found, false otherwise.
Throws:
ASN1EncodingException - Thrown if the null was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readNull

public boolean readNull(int tagType,
                        int tag,
                        int clsFlags,
                        boolean defaultValue)
                 throws ASN1EncodingException
Reads a null in from the ASN1 input with tagging.

Parameters:
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.
Returns:
True if the null was found, false otherwise.
Throws:
ASN1EncodingException - Thrown if the null was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readInteger

public int readInteger()
                throws ASN1EncodingException
Reads an integer in from the ASN1 input.

Returns:
The integer value.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readInteger

public int readInteger(int tagType,
                       int tag)
                throws ASN1EncodingException
Reads an integer in from the ASN1 input with tagging.

Parameters:
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).
Returns:
The integer value.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readInteger

public int readInteger(int tagType,
                       int tag,
                       int defaultValue)
                throws ASN1EncodingException
Reads an integer in from the ASN1 input with tagging.

Parameters:
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.
Returns:
The integer value, or default value if the expected tag could not be found.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readInteger

public int readInteger(int tagType,
                       int tag,
                       int clsFlags,
                       int defaultValue)
                throws ASN1EncodingException
Reads an integer in from the ASN1 input with tagging.

Parameters:
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 )
Returns:
The integer value, or default value if the expected tag could not be found.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readEnumerated

public int readEnumerated()
                   throws ASN1EncodingException
Reads an enumerated integer in from the ASN1 input.

Returns:
The enumerated integer value.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readEnumerated

public int readEnumerated(int tagType,
                          int tag)
                   throws ASN1EncodingException
Reads an enumerated integer in from the ASN1 input with tagging.

Parameters:
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).
Returns:
The enumerated integer value.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readEnumerated

public int readEnumerated(int tagType,
                          int tag,
                          int defaultValue)
                   throws ASN1EncodingException
Reads an enumerated integer in from the ASN1 input with tagging.

Parameters:
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.
Returns:
The enumerated integer value, or default value if the expected tag could not be found.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readEnumerated

public int readEnumerated(int tagType,
                          int tag,
                          int clsFlags,
                          int defaultValue)
                   throws ASN1EncodingException
Reads an enumerated integer in from the ASN1 input with tagging.

Parameters:
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 )
Returns:
The enumerated integer value, or default value if the expected tag could not be found.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readIntegerAsByteArray

public byte[] readIntegerAsByteArray()
                              throws ASN1EncodingException
Reads an integer (as a byte array) in from the ASN1 input.

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.

Returns:
the integer value.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readIntegerAsByteArray

public byte[] readIntegerAsByteArray(int tagType,
                                     int tag)
                              throws ASN1EncodingException
Reads an integer (as a byte array) in from the ASN1 input with tagging.

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.

Parameters:
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).
Returns:
the integer value.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readIntegerAsByteArray

public byte[] readIntegerAsByteArray(int tagType,
                                     int tag,
                                     byte[] defaultValue)
                              throws ASN1EncodingException
Reads an integer (as a byte array) in from the ASN1 input with tagging.

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.

Parameters:
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.
Returns:
the integer value, or default value if the expected tag could not be found.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readIntegerAsByteArray

public byte[] readIntegerAsByteArray(int tagType,
                                     int tag,
                                     int clsFlags)
                              throws ASN1EncodingException
Reads an integer (as a byte array) in from the ASN1 input with tagging.

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.

Parameters:
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 )
Returns:
the integer value, or default value if the expected tag could not be found.
Throws:
ASN1EncodingException - Thrown if the boolean was incorrectly formatted.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

readIntegerAsByteArray

public byte[] readIntegerAsByteArray(int tagType,
                                     int tag,
                                     int clsFlags,
                                     byte[] defaultValu