public class Asn1CerOutputStream extends Asn1BerOutputStream
os| Constructor and Description |
|---|
Asn1CerOutputStream(java.io.OutputStream os)
This constructor creates a CER output stream object with
default size of buffer.
|
Asn1CerOutputStream(java.io.OutputStream os,
int bufSize)
This constructor creates a buffered CER output stream object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encode(Asn1Type object,
boolean explicit)
This method encodes and writes to the stream ASN.1 types.
|
void |
encodeBitString(byte[] value,
int numbits,
boolean explicit,
Asn1Tag tag)
This method writes the given array of bytes as bit string value.
|
void |
encodeBMPString(java.lang.String value,
boolean explicit,
Asn1Tag tag)
This method writes the given string as BMP string value.
|
void |
encodeCharString(java.lang.String value,
boolean explicit,
Asn1Tag tag)
This method encodes and writes to the stream an ASN.1 8-bit character
string types including IA5String, PrintableString, NumericString, etc.
|
void |
encodeOctetString(byte[] value,
boolean explicit,
Asn1Tag tag)
This method writes the given array of bytes as octet string value.
|
void |
encodeStringTag(int nbytes,
Asn1Tag tag)
This method encodes and writes both a tag and length value to the stream.
|
void |
encodeStringTag(int nbytes,
short tagClass,
short tagForm,
int tagIDCode)
This method encodes and writes both a tag and length value to the stream.
|
void |
encodeUnivString(int[] value,
boolean explicit,
Asn1Tag tag)
This method writes the given array of integers as UniversalString value.
|
boolean |
isBER()
This method is used for testing encode rules type.
|
encodeEOC, encodeIdentifier, encodeIntValue, encodeLength, encodeTag, encodeTag, encodeTagAndIndefLen, encodeTagAndIndefLen, encodeTagAndLengthclose, flush, getContext, write, write, write, write2Bytes, write4Bytespublic Asn1CerOutputStream(java.io.OutputStream os)
os - The underlying OutputStream object.public Asn1CerOutputStream(java.io.OutputStream os,
int bufSize)
os - The underlying OutputStream object.bufSize - The buffer size. If it is 0 then the output stream
is used as unbuffered one.public void encodeBMPString(java.lang.String value,
boolean explicit,
Asn1Tag tag)
throws Asn1Exception,
java.io.IOException
encodeBMPString in class Asn1BerOutputStreamvalue - String containing data to encode.explicit - Flag indicating explicit tagging should be donetag - Universal tag to applyjava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void encodeBitString(byte[] value,
int numbits,
boolean explicit,
Asn1Tag tag)
throws Asn1Exception,
java.io.IOException
encodeBitString in class Asn1BerOutputStreamvalue - Byte array containing data to encode.numbits - Number of bits to encodeexplicit - Flag indicating explicit tagging should be donetag - Universal tag to applyjava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void encodeCharString(java.lang.String value,
boolean explicit,
Asn1Tag tag)
throws Asn1Exception,
java.io.IOException
encodeCharString in class Asn1BerOutputStreamvalue - The string object to be writtenexplicit - Flag indicating explicit tagging should be donetag - Universal tag to applyjava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void encodeOctetString(byte[] value,
boolean explicit,
Asn1Tag tag)
throws Asn1Exception,
java.io.IOException
encodeOctetString in class Asn1BerOutputStreamvalue - Byte array containing data to encode.explicit - Flag indicating explicit tagging should be donetag - Universal tag to applyjava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void encodeStringTag(int nbytes,
Asn1Tag tag)
throws java.io.IOException
nbytes - The number of bytes in string to be encoded.tag - The tag to be encoded.java.io.IOException - Any exception thrown by the underlying OutputStream.public void encodeStringTag(int nbytes,
short tagClass,
short tagForm,
int tagIDCode)
throws java.io.IOException
nbytes - The number of bytes in string to be encoded.tagClass - The class of the tag to be encoded.tagForm - The form of the tag to be encoded.tagIDCode - The ID code of the tag to be encoded.java.io.IOException - Any exception thrown by the underlying OutputStream.public void encodeUnivString(int[] value,
boolean explicit,
Asn1Tag tag)
throws Asn1Exception,
java.io.IOException
encodeUnivString in class Asn1BerOutputStreamvalue - Array containing data to encode.explicit - Flag indicating explicit tagging should be donetag - Universal tag to applyjava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exception - Thrown, if operation is failed.public void encode(Asn1Type object, boolean explicit) throws java.io.IOException, Asn1Exception
encode in class Asn1BerOutputStreamobject - The object to be writtenexplicit - Flag indicating explicit tagging should be donejava.io.IOException - Any exception thrown by the underlying OutputStream.Asn1Exceptionpublic boolean isBER()
isBER in class Asn1BerOutputStream