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

java.lang.Object
  extended by net.rim.device.api.crypto.asn1.ASN1OutputStream

public class ASN1OutputStream
extends Object

An output stream which outputs bytes according to the ASN.1 Distinguished Encoding Rules (DER) format/encoding specification.

Example Usage:

The following example outputs a Test type sequence of DER-encoded bytes to a file, in the ASN.1 format: Note: Exception catching is omitted for clarity.
 Test   ::=   SEQUENCE {
      myNumber    INTEGER,
      myArray     OCTET_STRING 
 }
 // The values of the fields of our Test type
 int myNumber = 3;
 byte[] myArray = { 0x01, 0x02, 0x03, 0x04 };
 
 OutputStream outputStream = ...;

 // Create an ASN.1 output stream (which uses DER encoding)
 ASN1OutputStream asn1Output = ASN1OutputStream( outputStream );

 // Create an ASN.1 sequence
 ASN1OutputStream sequence = new ASN1OutputStream();

 // Write the integer value 3 to the sequence
 sequence.writeInteger(myNumber);

 // Output the byte array
 sequence.writeBytes(myArray);

 // Finally, output the sequence to the ASN1 output stream
 asn1Output.writeSequence( sequence );
 

See Also:
DERTags, ASN1InputStream
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

Constructor Summary
Category: Signed ASN1OutputStream()
          Constructs an ASN1OutputStream which writes some unknown number of bytes using a ByteArrayOutputStream.
Category: Signed ASN1OutputStream(OutputStream outputStream)
          Constructs an ASN1OutputStream which writes some unknown number of bytes.
 
Method Summary
Category: Signed  byte[] toByteArray()
          Returns the encoding of everything written to the stream so far.
Category: Signed  void writeBMPString(String value)
          Writes a BMP string to the output stream.
Category: Signed  void writeBMPString(String value, int tagging, int tag)
          Writes a string to the output stream, using the BMP format by default, with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeBMPString(String value, int tagging, int tag, int clsFlags)
          Writes a string to the output stream, using the BMP format.
Category: Signed  void writeBitString(byte[] value)
          Writes a bit string to the output stream.
Category: Signed  void writeBitString(byte[] value, int tagging, int tag)
          Writes a bit string to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeBitString(byte[] value, int tagging, int tag, int clsFlags)
          Writes a bit string to the output stream.
Category: Signed  void writeBitString(ASN1BitSet value)
          Writes a bit string to the output stream.
Category: Signed  void writeBitString(ASN1BitSet value, int tagging, int tag)
          Writes a bit string to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeBitString(ASN1BitSet value, int tagging, int tag, int clsFlags)
          Writes a bit string to the output stream.
Category: Signed  void writeBoolean(boolean value)
          Writes a boolean value to the output stream.
Category: Signed  void writeBoolean(boolean value, int tagging, int tag)
          Writes a boolean value to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeBoolean(boolean value, int tagging, int tag, int clsFlags)
          Writes a boolean value to the output stream.
Category: Signed  void writeEnumerated(int value)
          Writes an enumerated value to the output stream.
Category: Signed  void writeEnumerated(int value, int tagging, int tag)
          Writes an enumerated value to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeEnumerated(int value, int tagging, int tag, int clsFlags)
          Writes an enumerated value to the output stream.
Category: Signed  void writeGeneralizedTime(long date)
          Writes a GeneralizedTime to the output stream.
Category: Signed  void writeGeneralizedTime(long date, int tagging, int tag)
          Writes a GeneralizedTime to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeGeneralizedTime(long date, int tagging, int tag, int clsFlags)
          Writes a GeneralizedTime to the output stream.
Category: Signed  void writeIA5String(String value)
          Writes an IA5 string to the output stream.
Category: Signed  void writeIA5String(String value, int tagging, int tag)
          Writes a string to the output stream, using the IA5 format, with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeIA5String(String value, int tagging, int tag, int clsFlags)
          Writes a string to the output stream, using the IA5 format.
Category: Signed  void writeInteger(byte[] value)
          Writes an integer (stored in a byte array) to the output stream.
Category: Signed  void writeInteger(byte[] value, int tagging, int tag)
          Writes an integer (stored in a byte array) to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeInteger(byte[] value, int tagging, int tag, int clsFlags)
          Writes an integer (stored in a byte array) to the output stream.
Category: Signed  void writeInteger(int value)
          Writes an integer value to the output stream.
Category: Signed  void writeInteger(int value, int tagging, int tag)
          Writes an integer value to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeInteger(int value, int tagging, int tag, int clsFlags)
          Writes an integer value to the output stream.
Category: Signed  void writeNull()
          Writes a null value to the output stream.
Category: Signed  void writeNull(int tagging, int tag)
          Writes a null value to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeNull(int tagging, int tag, int clsFlags)
          Writes a null value to the output stream.
Category: Signed  void writeOID(OID value)
          Writes an OBJECT_IDENTIFIER (OID) to the output stream.
Category: Signed  void writeOID(OID value, int tagging, int tag)
          Writes an OBJECT_IDENTIFIER (OID) to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeOID(OID value, int tagging, int tag, int clsFlags)
          Writes an OBJECT_IDENTIFIER to the output stream.
Category: Signed  void writeOctetString(byte[] value)
          Writes an octet string to the output stream.
Category: Signed  void writeOctetString(byte[] value, int tagging, int tag)
          Writes an octet string to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeOctetString(byte[] value, int tagging, int tag, int clsFlags)
          Writes an octet string to the output stream.
Category: Signed  void writePrintableString(String value)
          Writes a PRINTABLE string to the output stream.
Category: Signed  void writePrintableString(String value, int tagging, int tag)
          Writes a string to the output stream, using the PRINTABLE format, with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writePrintableString(String value, int tagging, int tag, int clsFlags)
          Writes a string to the output stream, using the PRINTABLE format.
Category: Signed  void writeRawByteArray(byte[] byteArrayToWrite)
          Writes a byte array to the output stream.
Category: Signed  void writeSequence(ASN1OutputStream sequence)
          Writes a sequence to the output stream.
Category: Signed  void writeSequence(ASN1OutputStream sequence, int tagging, int tag)
          Writes a sequence to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeSequence(ASN1OutputStream sequence, int tagging, int tag, int clsFlags)
          Writes a sequence to the output stream.
Category: Signed  void writeSet(ASN1OutputStream set)
          Writes a set to the output stream.
Category: Signed  void writeSet(ASN1OutputStream set, int tagging, int tag)
          Writes a set to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeSet(ASN1OutputStream set, int tagging, int tag, int clsFlags)
          Writes a set to the output stream.
Category: Signed  void writeStreamWithTag(ASN1OutputStream stream, int tagging, int tag)
          Writes a stream to the output, adding on the tags.
Category: Signed  void writeString(String value)
          Writes a string to the output stream, using the UTF8 format by default.
Category: Signed  void writeString(String value, int tagging, int tag)
          Writes a string to the output stream, using the UTF8 format by default, with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeString(String value, int tagging, int tag, int clsFlags)
          Writes a string to the output stream, using the UTF8 format by default.
Category: Signed  void writeT61String(String value)
          Writes a T61 string to the output stream.
Category: Signed  void writeT61String(String value, int tagging, int tag)
          Writes a string to the output stream, using the T61 format, with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeT61String(String value, int tagging, int tag, int clsFlags)
          Writes a string to the output stream, using the T61 format.
Category: Signed  void writeTime(long date)
          Writes the appropriate (UTCTime / GeneralizedTime) to the output stream.
Category: Signed  void writeUTCTime(long date)
          Writes a UTCTime to the output stream.
Category: Signed  void writeUTCTime(long date, int tagging, int tag)
          Writes a UTCTime to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeUTCTime(long date, int tagging, int tag, int clsFlags)
          Writes a UTCTime to the output stream.
Category: Signed  void writeUTF8String(String value)
          Writes a UTF8 string to the output stream.
Category: Signed  void writeUTF8String(String value, int tagging, int tag)
          Writes a string to the output stream, using the UTF8 format, with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.
Category: Signed  void writeUTF8String(String value, int tagging, int tag, int clsFlags)
          Writes a string to the output stream, using the UTF8 format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

ASN1OutputStream

public ASN1OutputStream()
Constructs an ASN1OutputStream which writes some unknown number of bytes using a ByteArrayOutputStream. To access the encoding, call toByteArray().

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

ASN1OutputStream

public ASN1OutputStream(OutputStream outputStream)
Constructs an ASN1OutputStream which writes some unknown number of bytes.

Note that if you want to be able to use this stream, as a sequence or a set, you should not use this constructor. The reason is that to encode a set or sequence, you need to be able to encode the contents of that set/sequence. When you use this constructor, the set/sequence data is immediately written to outputStream and hence cannot be encoded. So don't use this constructor if you wish this ASN1OutputStream to be a set/sequence.

Parameters:
outputStream - The stream to write the output to.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0


Method Detail

toByteArray

public byte[] toByteArray()
Returns the encoding of everything written to the stream so far. Null is returned if the underlying stream is not a byte array output stream.

Returns:
The byte array.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeBoolean

public void writeBoolean(boolean value)
                  throws IOException
Writes a boolean value to the output stream.

Parameters:
value - The value to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeBoolean

public void writeBoolean(boolean value,
                         int tagging,
                         int tag)
                  throws IOException
Writes a boolean value to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The value to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeBoolean

public void writeBoolean(boolean value,
                         int tagging,
                         int tag,
                         int clsFlags)
                  throws IOException
Writes a boolean value to the output stream.

Parameters:
value - The value to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeNull

public void writeNull()
               throws IOException
Writes a null value to the output stream.

Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeNull

public void writeNull(int tagging,
                      int tag)
               throws IOException
Writes a null value to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeNull

public void writeNull(int tagging,
                      int tag,
                      int clsFlags)
               throws IOException
Writes a null value to the output stream.

Parameters:
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeInteger

public void writeInteger(int value)
                  throws IOException
Writes an integer value to the output stream.

Parameters:
value - The value to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeInteger

public void writeInteger(int value,
                         int tagging,
                         int tag)
                  throws IOException
Writes an integer value to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The value to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeInteger

public void writeInteger(int value,
                         int tagging,
                         int tag,
                         int clsFlags)
                  throws IOException
Writes an integer value to the output stream.

Parameters:
value - The value to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeEnumerated

public void writeEnumerated(int value)
                     throws IOException
Writes an enumerated value to the output stream.

Parameters:
value - The value to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeEnumerated

public void writeEnumerated(int value,
                            int tagging,
                            int tag)
                     throws IOException
Writes an enumerated value to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The value to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeEnumerated

public void writeEnumerated(int value,
                            int tagging,
                            int tag,
                            int clsFlags)
                     throws IOException
Writes an enumerated value to the output stream.

Parameters:
value - The value to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeInteger

public void writeInteger(byte[] value)
                  throws IOException
Writes an integer (stored in a byte array) to the output stream.

Parameters:
value - The value to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeInteger

public void writeInteger(byte[] value,
                         int tagging,
                         int tag)
                  throws IOException
Writes an integer (stored in a byte array) to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The value to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeInteger

public void writeInteger(byte[] value,
                         int tagging,
                         int tag,
                         int clsFlags)
                  throws IOException
Writes an integer (stored in a byte array) to the output stream.

Parameters:
value - The value to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeSequence

public void writeSequence(ASN1OutputStream sequence)
                   throws IOException
Writes a sequence to the output stream.

The ASN1OutputStream sequence with the data must have a been created with an underlying ByteArrayOutputStream, else this function will not work ( and will throw an IllegalArgumentException.

Parameters:
sequence - The sequence to write.
Throws:
IOException - Thrown in the case of an I/O error.
IllegalArgumentException - Thrown if sequence was not created with an underlying ByteArrayOutputStream.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeSequence

public void writeSequence(ASN1OutputStream sequence,
                          int tagging,
                          int tag)
                   throws IOException
Writes a sequence to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

The ASN1OutputStream sequence with the data must have a been created with an underlying ByteArrayOutputStream, else this function will not work ( and will throw an IllegalArgumentException.

Parameters:
sequence - The sequence to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
IllegalArgumentException - Thrown if sequence was not created with an underlying ByteArrayOutputStream.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeSequence

public void writeSequence(ASN1OutputStream sequence,
                          int tagging,
                          int tag,
                          int clsFlags)
                   throws IOException
Writes a sequence to the output stream.

The ASN1OutputStream sequence with the data must have a been created with an underlying ByteArrayOutputStream, else this function will not work ( and will throw an IllegalArgumentException.

Parameters:
sequence - The sequence to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
IllegalArgumentException - Thrown if sequence was not created with an underlying ByteArrayOutputStream.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeSet

public void writeSet(ASN1OutputStream set)
              throws IOException
Writes a set to the output stream.

The ASN1OutputStream set with the data must have a been created with an underlying ByteArrayOutputStream, else this function will not work ( and will throw an IllegalArgumentException.

NOTE: The order the components of the set are written to this ASN1OutputStream is the order that they were written to set. No explicit ordering ( whether by tag or lexicographic ) is carried out by this function. It is up to the user to look after the ordering, if they so desire.

Parameters:
set - The set to write.
Throws:
IOException - Thrown in the case of an I/O error.
IllegalArgumentException - Thrown if set was not created with an underlying ByteArrayOutputStream.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeSet

public void writeSet(ASN1OutputStream set,
                     int tagging,
                     int tag)
              throws IOException
Writes a set to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

The ASN1OutputStream set with the data must have a been created with an underlying ByteArrayOutputStream, else this function will not work ( and will throw an IllegalArgumentException.

NOTE: The order the components of the set are written to this ASN1OutputStream is the order that they were written to set. No explicit ordering ( whether by tag or lexicographic ) is carried out by this function. It is up to the user to look after the ordering, if they so desire.

Parameters:
set - The set to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
IllegalArgumentException - Thrown if set was not created with an underlying ByteArrayOutputStream.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeSet

public void writeSet(ASN1OutputStream set,
                     int tagging,
                     int tag,
                     int clsFlags)
              throws IOException
Writes a set to the output stream.

The ASN1OutputStream set with the data must have a been created with an underlying ByteArrayOutputStream, else this function will not work ( and will throw an IllegalArgumentException.

NOTE: The order the components of the set are written to this ASN1OutputStream is the order that they were written to set. No explicit ordering ( whether by tag or lexicographic ) is carried out by this function. It is up to the user to look after the ordering, if they so desire.

Parameters:
set - The set to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
IllegalArgumentException - Thrown if set was not created with an underlying ByteArrayOutputStream.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writePrintableString

public void writePrintableString(String value)
                          throws IOException
Writes a PRINTABLE string to the output stream.

Parameters:
value - The string to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writePrintableString

public void writePrintableString(String value,
                                 int tagging,
                                 int tag)
                          throws IOException
Writes a string to the output stream, using the PRINTABLE format, with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The string to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writePrintableString

public void writePrintableString(String value,
                                 int tagging,
                                 int tag,
                                 int clsFlags)
                          throws IOException
Writes a string to the output stream, using the PRINTABLE format.

Parameters:
value - The string to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeIA5String

public void writeIA5String(String value)
                    throws IOException
Writes an IA5 string to the output stream.

Parameters:
value - The string to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeIA5String

public void writeIA5String(String value,
                           int tagging,
                           int tag)
                    throws IOException
Writes a string to the output stream, using the IA5 format, with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The string to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeIA5String

public void writeIA5String(String value,
                           int tagging,
                           int tag,
                           int clsFlags)
                    throws IOException
Writes a string to the output stream, using the IA5 format.

Parameters:
value - The string to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeT61String

public void writeT61String(String value)
                    throws IOException
Writes a T61 string to the output stream.

Parameters:
value - The string to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeT61String

public void writeT61String(String value,
                           int tagging,
                           int tag)
                    throws IOException
Writes a string to the output stream, using the T61 format, with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The string to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeT61String

public void writeT61String(String value,
                           int tagging,
                           int tag,
                           int clsFlags)
                    throws IOException
Writes a string to the output stream, using the T61 format.

Parameters:
value - The string to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeUTF8String

public void writeUTF8String(String value)
                     throws IOException
Writes a UTF8 string to the output stream.

Parameters:
value - The string to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeUTF8String

public void writeUTF8String(String value,
                            int tagging,
                            int tag)
                     throws IOException
Writes a string to the output stream, using the UTF8 format, with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The string to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeUTF8String

public void writeUTF8String(String value,
                            int tagging,
                            int tag,
                            int clsFlags)
                     throws IOException
Writes a string to the output stream, using the UTF8 format.

Parameters:
value - The string to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeBMPString

public void writeBMPString(String value)
                    throws IOException
Writes a BMP string to the output stream.

Parameters:
value - The string to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeBMPString

public void writeBMPString(String value,
                           int tagging,
                           int tag)
                    throws IOException
Writes a string to the output stream, using the BMP format by default, with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The string to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeBMPString

public void writeBMPString(String value,
                           int tagging,
                           int tag,
                           int clsFlags)
                    throws IOException
Writes a string to the output stream, using the BMP format.

Parameters:
value - The string to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeString

public void writeString(String value)
                 throws IOException
Writes a string to the output stream, using the UTF8 format by default.

Parameters:
value - The string to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeString

public void writeString(String value,
                        int tagging,
                        int tag)
                 throws IOException
Writes a string to the output stream, using the UTF8 format by default, with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The string to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeString

public void writeString(String value,
                        int tagging,
                        int tag,
                        int clsFlags)
                 throws IOException
Writes a string to the output stream, using the UTF8 format by default.

Parameters:
value - The string to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeOctetString

public void writeOctetString(byte[] value)
                      throws IOException
Writes an octet string to the output stream.

Parameters:
value - The byte array to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeOctetString

public void writeOctetString(byte[] value,
                             int tagging,
                             int tag)
                      throws IOException
Writes an octet string to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The byte array to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeOctetString

public void writeOctetString(byte[] value,
                             int tagging,
                             int tag,
                             int clsFlags)
                      throws IOException
Writes an octet string to the output stream.

Parameters:
value - The byte array to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeTime

public void writeTime(long date)
               throws IOException
Writes the appropriate (UTCTime / GeneralizedTime) to the output stream.

Parameters:
date - The time to be written, assumed to be in GMT.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.5.0

writeUTCTime

public void writeUTCTime(long date)
                  throws IOException
Writes a UTCTime to the output stream.

Parameters:
date - The time to be written, assumed to be in GMT.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeUTCTime

public void writeUTCTime(long date,
                         int tagging,
                         int tag)
                  throws IOException
Writes a UTCTime to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
date - The time to be written, assumed to be in GMT
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeUTCTime

public void writeUTCTime(long date,
                         int tagging,
                         int tag,
                         int clsFlags)
                  throws IOException
Writes a UTCTime to the output stream.

Parameters:
date - The time to be written, assumed to be in GMT.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeGeneralizedTime

public void writeGeneralizedTime(long date)
                          throws IOException
Writes a GeneralizedTime to the output stream.

Parameters:
date - The time to be written, assumed to be in GMT.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeGeneralizedTime

public void writeGeneralizedTime(long date,
                                 int tagging,
                                 int tag)
                          throws IOException
Writes a GeneralizedTime to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
date - The time to be written, assumed to be in GMT.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeGeneralizedTime

public void writeGeneralizedTime(long date,
                                 int tagging,
                                 int tag,
                                 int clsFlags)
                          throws IOException
Writes a GeneralizedTime to the output stream.

Parameters:
date - The time to be written, assumed to be in GMT.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeOID

public void writeOID(OID value)
              throws IOException
Writes an OBJECT_IDENTIFIER (OID) to the output stream.

Parameters:
value - The OID to be written.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeOID

public void writeOID(OID value,
                     int tagging,
                     int tag)
              throws IOException
Writes an OBJECT_IDENTIFIER (OID) to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The OID to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeOID

public void writeOID(OID value,
                     int tagging,
                     int tag,
                     int clsFlags)
              throws IOException
Writes an OBJECT_IDENTIFIER to the output stream.

Parameters:
value - The OID to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeBitString

public void writeBitString(ASN1BitSet value)
                    throws IOException
Writes a bit string to the output stream.

Parameters:
value - The ASN1BitSet to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeBitString

public void writeBitString(ASN1BitSet value,
                           int tagging,
                           int tag)
                    throws IOException
Writes a bit string to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The ASN1BitSet to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeBitString

public void writeBitString(ASN1BitSet value,
                           int tagging,
                           int tag,
                           int clsFlags)
                    throws IOException
Writes a bit string to the output stream.

Parameters:
value - The ASN1BitSet to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeBitString

public void writeBitString(byte[] value)
                    throws IOException
Writes a bit string to the output stream.

Parameters:
value - The byte array to write.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeBitString

public void writeBitString(byte[] value,
                           int tagging,
                           int tag)
                    throws IOException
Writes a bit string to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default.

Parameters:
value - The byte array to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeBitString

public void writeBitString(byte[] value,
                           int tagging,
                           int tag,
                           int clsFlags)
                    throws IOException
Writes a bit string to the output stream.

Parameters:
value - The byte array to write.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use (ignored if tagging is TAG_NONE).
clsFlags - The class flag to write with this tag ( either DERTags.UNIVERSAL_CLASS_FLAG, DERTags.APPLICATION_SPECIFIC_CLASS_FLAG, DERTags.CONTEXT_SPECIFIC_CLASS_FLAG or DERTags.PRIVATE_CLASS_FLAG )
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeRawByteArray

public void writeRawByteArray(byte[] byteArrayToWrite)
                       throws IOException
Writes a byte array to the output stream.

Note that NO encoding is used here. Call this method when byteArrayToWrite has already been formatted by some other means.

Parameters:
byteArrayToWrite - The array to written.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

writeStreamWithTag

public void writeStreamWithTag(ASN1OutputStream stream,
                               int tagging,
                               int tag)
                        throws IOException
Writes a stream to the output, adding on the tags.

Use this to encode data where multiple embedded implicit and explicit tags are used. The contents of the stream will have the tag ( and length ) prepended. Including the TAG_EXPLICIT or TAG_IMPLICIT will add the proper class flags for reading this back.

Parameters:
stream - The stream to write out.
tagging - The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).
tag - The tag value to use.
Throws:
IOException - Thrown in the case of an I/O error.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal