|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.crypto.asn1.ASN1OutputStream
public class ASN1OutputStream
An output stream which outputs bytes according to the ASN.1 Distinguished Encoding Rules (DER) format/encoding specification.
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 );
DERTags
,
ASN1InputStream
Constructor Summary | ||
---|---|---|
|
ASN1OutputStream()
Constructs an ASN1OutputStream which writes some unknown number of bytes using a
ByteArrayOutputStream . |
|
|
ASN1OutputStream(OutputStream outputStream)
Constructs an ASN1OutputStream which writes some unknown number of bytes. |
Method Summary | ||
---|---|---|
|
byte[] |
toByteArray()
Returns the encoding of everything written to the stream so far. |
|
void |
writeBMPString(String value)
Writes a BMP string to the output stream. |
|
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. |
|
void |
writeBMPString(String value,
int tagging,
int tag,
int clsFlags)
Writes a string to the output stream, using the BMP format. |
|
void |
writeBitString(byte[] value)
Writes a bit string to the output stream. |
|
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. |
|
void |
writeBitString(byte[] value,
int tagging,
int tag,
int clsFlags)
Writes a bit string to the output stream. |
|
void |
writeBitString(ASN1BitSet value)
Writes a bit string to the output stream. |
|
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. |
|
void |
writeBitString(ASN1BitSet value,
int tagging,
int tag,
int clsFlags)
Writes a bit string to the output stream. |
|
void |
writeBoolean(boolean value)
Writes a boolean value to the output stream. |
|
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. |
|
void |
writeBoolean(boolean value,
int tagging,
int tag,
int clsFlags)
Writes a boolean value to the output stream. |
|
void |
writeEnumerated(int value)
Writes an enumerated value to the output stream. |
|
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. |
|
void |
writeEnumerated(int value,
int tagging,
int tag,
int clsFlags)
Writes an enumerated value to the output stream. |
|
void |
writeGeneralizedTime(long date)
Writes a GeneralizedTime to the output stream. |
|
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. |
|
void |
writeGeneralizedTime(long date,
int tagging,
int tag,
int clsFlags)
Writes a GeneralizedTime to the output stream. |
|
void |
writeIA5String(String value)
Writes an IA5 string to the output stream. |
|
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. |
|
void |
writeIA5String(String value,
int tagging,
int tag,
int clsFlags)
Writes a string to the output stream, using the IA5 format. |
|
void |
writeInteger(byte[] value)
Writes an integer (stored in a byte array) to the output stream. |
|
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. |
|
void |
writeInteger(byte[] value,
int tagging,
int tag,
int clsFlags)
Writes an integer (stored in a byte array) to the output stream. |
|
void |
writeInteger(int value)
Writes an integer value to the output stream. |
|
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. |
|
void |
writeInteger(int value,
int tagging,
int tag,
int clsFlags)
Writes an integer value to the output stream. |
|
void |
writeNull()
Writes a null value to the output stream. |
|
void |
writeNull(int tagging,
int tag)
Writes a null value to the output stream with tagging using the CONTEXT_SPECIFIC_CLASS_FLAG as default. |
|
void |
writeNull(int tagging,
int tag,
int clsFlags)
Writes a null value to the output stream. |
|
void |
writeOID(OID value)
Writes an OBJECT_IDENTIFIER (OID) to the output stream. |
|
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. |
|
void |
writeOID(OID value,
int tagging,
int tag,
int clsFlags)
Writes an OBJECT_IDENTIFIER to the output stream. |
|
void |
writeOctetString(byte[] value)
Writes an octet string to the output stream. |
|
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. |
|
void |
writeOctetString(byte[] value,
int tagging,
int tag,
int clsFlags)
Writes an octet string to the output stream. |
|
void |
writePrintableString(String value)
Writes a PRINTABLE string to the output stream. |
|
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. |
|
void |
writePrintableString(String value,
int tagging,
int tag,
int clsFlags)
Writes a string to the output stream, using the PRINTABLE format. |
|
void |
writeRawByteArray(byte[] byteArrayToWrite)
Writes a byte array to the output stream. |
|
void |
writeSequence(ASN1OutputStream sequence)
Writes a sequence to the output stream. |
|
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. |
|
void |
writeSequence(ASN1OutputStream sequence,
int tagging,
int tag,
int clsFlags)
Writes a sequence to the output stream. |
|
void |
writeSet(ASN1OutputStream set)
Writes a set to the output stream. |
|
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. |
|
void |
writeSet(ASN1OutputStream set,
int tagging,
int tag,
int clsFlags)
Writes a set to the output stream. |
|
void |
writeStreamWithTag(ASN1OutputStream stream,
int tagging,
int tag)
Writes a stream to the output, adding on the tags. |
|
void |
writeString(String value)
Writes a string to the output stream, using the UTF8 format by default. |
|
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. |
|
void |
writeString(String value,
int tagging,
int tag,
int clsFlags)
Writes a string to the output stream, using the UTF8 format by default. |
|
void |
writeT61String(String value)
Writes a T61 string to the output stream. |
|
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. |
|
void |
writeT61String(String value,
int tagging,
int tag,
int clsFlags)
Writes a string to the output stream, using the T61 format. |
|
void |
writeTime(long date)
Writes the appropriate (UTCTime / GeneralizedTime) to the output stream. |
|
void |
writeUTCTime(long date)
Writes a UTCTime to the output stream. |
|
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. |
|
void |
writeUTCTime(long date,
int tagging,
int tag,
int clsFlags)
Writes a UTCTime to the output stream. |
|
void |
writeUTF8String(String value)
Writes a UTF8 string to the output stream. |
|
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. |
|
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 |
---|
public ASN1OutputStream()
ASN1OutputStream
which writes some unknown number of bytes using a
ByteArrayOutputStream
. To access the encoding, call toByteArray()
.
public ASN1OutputStream(OutputStream outputStream)
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.
outputStream
- The stream to write the output to.Method Detail |
---|
public byte[] toByteArray()
Null
is returned
if the underlying stream is not a byte array output stream.
public void writeBoolean(boolean value) throws IOException
value
- The value to write.
IOException
- Thrown in the case of an I/O error.public void writeBoolean(boolean value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeBoolean(boolean value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeNull() throws IOException
IOException
- Thrown in the case of an I/O error.public void writeNull(int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeNull(int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeInteger(int value) throws IOException
value
- The value to write.
IOException
- Thrown in the case of an I/O error.public void writeInteger(int value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeInteger(int value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeEnumerated(int value) throws IOException
value
- The value to write.
IOException
- Thrown in the case of an I/O error.public void writeEnumerated(int value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeEnumerated(int value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeInteger(byte[] value) throws IOException
value
- The value to write.
IOException
- Thrown in the case of an I/O error.public void writeInteger(byte[] value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeInteger(byte[] value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeSequence(ASN1OutputStream sequence) throws IOException
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.
sequence
- The sequence to write.
IOException
- Thrown in the case of an I/O error.
IllegalArgumentException
- Thrown if sequence
was not created with an underlying
ByteArrayOutputStream.public void writeSequence(ASN1OutputStream sequence, int tagging, int tag) throws IOException
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.
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).
IOException
- Thrown in the case of an I/O error.
IllegalArgumentException
- Thrown if sequence
was not created with an underlying
ByteArrayOutputStream.public void writeSequence(ASN1OutputStream sequence, int tagging, int tag, int clsFlags) throws IOException
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.
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 )
IOException
- Thrown in the case of an I/O error.
IllegalArgumentException
- Thrown if sequence
was not created with an underlying
ByteArrayOutputStream.public void writeSet(ASN1OutputStream set) throws IOException
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.
set
- The set to write.
IOException
- Thrown in the case of an I/O error.
IllegalArgumentException
- Thrown if set
was not created with an underlying
ByteArrayOutputStream.public void writeSet(ASN1OutputStream set, int tagging, int tag) throws IOException
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.
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).
IOException
- Thrown in the case of an I/O error.
IllegalArgumentException
- Thrown if set
was not created with an underlying
ByteArrayOutputStream.public void writeSet(ASN1OutputStream set, int tagging, int tag, int clsFlags) throws IOException
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.
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 )
IOException
- Thrown in the case of an I/O error.
IllegalArgumentException
- Thrown if set
was not created with an underlying
ByteArrayOutputStream.public void writePrintableString(String value) throws IOException
value
- The string to write.
IOException
- Thrown in the case of an I/O error.public void writePrintableString(String value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writePrintableString(String value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeIA5String(String value) throws IOException
value
- The string to write.
IOException
- Thrown in the case of an I/O error.public void writeIA5String(String value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeIA5String(String value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeT61String(String value) throws IOException
value
- The string to write.
IOException
- Thrown in the case of an I/O error.public void writeT61String(String value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeT61String(String value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeUTF8String(String value) throws IOException
value
- The string to write.
IOException
- Thrown in the case of an I/O error.public void writeUTF8String(String value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeUTF8String(String value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeBMPString(String value) throws IOException
value
- The string to write.
IOException
- Thrown in the case of an I/O error.public void writeBMPString(String value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeBMPString(String value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeString(String value) throws IOException
value
- The string to write.
IOException
- Thrown in the case of an I/O error.public void writeString(String value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeString(String value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeOctetString(byte[] value) throws IOException
value
- The byte array to write.
IOException
- Thrown in the case of an I/O error.public void writeOctetString(byte[] value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeOctetString(byte[] value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeTime(long date) throws IOException
date
- The time to be written, assumed to be in GMT.
IOException
- Thrown in the case of an I/O error.public void writeUTCTime(long date) throws IOException
date
- The time to be written, assumed to be in GMT.
IOException
- Thrown in the case of an I/O error.public void writeUTCTime(long date, int tagging, int tag) throws IOException
date
- The time to be written, assumed to be in GMTtagging
- The type of tagging to use (TAG_NONE, TAG_IMPLICIT, TAG_EXPLICIT).tag
- The tag value to use (ignored if tagging is TAG_NONE).
IOException
- Thrown in the case of an I/O error.public void writeUTCTime(long date, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeGeneralizedTime(long date) throws IOException
date
- The time to be written, assumed to be in GMT.
IOException
- Thrown in the case of an I/O error.public void writeGeneralizedTime(long date, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeGeneralizedTime(long date, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeOID(OID value) throws IOException
value
- The OID to be written.
IOException
- Thrown in the case of an I/O error.public void writeOID(OID value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeOID(OID value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeBitString(ASN1BitSet value) throws IOException
value
- The ASN1BitSet to write.
IOException
- Thrown in the case of an I/O error.public void writeBitString(ASN1BitSet value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeBitString(ASN1BitSet value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeBitString(byte[] value) throws IOException
value
- The byte array to write.
IOException
- Thrown in the case of an I/O error.public void writeBitString(byte[] value, int tagging, int tag) throws IOException
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).
IOException
- Thrown in the case of an I/O error.public void writeBitString(byte[] value, int tagging, int tag, int clsFlags) throws IOException
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 )
IOException
- Thrown in the case of an I/O error.public void writeRawByteArray(byte[] byteArrayToWrite) throws IOException
Note that NO encoding is used here. Call this method when byteArrayToWrite
has already been formatted by some other means.
byteArrayToWrite
- The array to written.
IOException
- Thrown in the case of an I/O error.public void writeStreamWithTag(ASN1OutputStream stream, int tagging, int tag) throws IOException
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.
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.
IOException
- Thrown in the case of an I/O error.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.