ASN1C C# Runtime Library
7.3
|
Public Member Functions | |
Asn1BerOutputStream (System.IO.Stream os) | |
Asn1BerOutputStream (System.IO.Stream os, int bufSize) | |
virtual void | Encode (Asn1Type type, bool explicitTagging) |
virtual void | EncodeBitString (byte[] data, int numbits, bool explicitTagging, Asn1Tag tag) |
virtual void | EncodeBMPString (System.String data, bool explicitTagging, Asn1Tag tag) |
virtual void | EncodeCharString (System.String data, bool explicitTagging, Asn1Tag tag) |
virtual void | EncodeEOC () |
virtual void | EncodeIdentifier (long ident) |
virtual void | EncodeIntValue (long data, bool encodeLen) |
virtual void | EncodeLength (int len) |
virtual void | EncodeOctetString (byte[] data, bool explicitTagging, Asn1Tag tag) |
virtual void | EncodeTag (Asn1Tag tag) |
virtual void | EncodeTag (short tagClass, short tagForm, int tagIDCode) |
virtual void | EncodeTagAndIndefLen (Asn1Tag tag) |
virtual void | EncodeTagAndIndefLen (short tagClass, short tagForm, int tagIDCode) |
virtual void | EncodeTagAndLength (Asn1Tag tag, int len) |
virtual void | EncodeUnivString (int[] data, bool explicitTagging, Asn1Tag tag) |
virtual void | EncodeUnsignedBinaryNumber (long data) |
Public Member Functions inherited from Asn1OutputStream | |
Asn1OutputStream (System.IO.Stream os) | |
override void | Close () |
override void | Flush () |
override int | Read (byte[] buffer, int offset, int count) |
override long | Seek (long offset, System.IO.SeekOrigin origin) |
override void | SetLength (long value) |
virtual void | Write (byte[] b) |
override void | Write (System.Byte[] b, int off, int len) |
void | Write2Bytes (int value) |
void | Write4Bytes (int value) |
virtual void | WriteByte (int b) |
override void | WriteByte (byte b) |
Additional Inherited Members | |
Properties inherited from Asn1OutputStream | |
override bool | CanRead [get] |
override bool | CanSeek [get] |
override bool | CanWrite [get] |
Asn1Context | Context [get] |
override long | Length [get] |
override long | Position [get, set] |
This class implements the output stream to encode ASN.1 messages as specified in the Basic Encoding Rules (BER) as specified in the ITU-T X.690 standard. A reference to an object of this type is passed to each of the ASN.1 type encode methods involved in encoding a particular message type.
Asn1BerOutputStream | ( | System.IO.Stream | os | ) |
This constructor creates a buffered BER output stream object with default size of buffer. Whenever the buffer becomes full, the buffer will be flushed to the stream.
os | The underlying System.IO.Stream object. |
Asn1BerOutputStream | ( | System.IO.Stream | os, |
int | bufSize | ||
) |
This constructor creates a buffered BER output stream object. Whenever the buffer becomes full, the buffer will be flushed to the stream.
os | The underlying System.IO.Stream object. |
bufSize | The buffer size. If it is 0 then the output stream is used as unbuffered one. |
|
virtual |
This method encodes and writes to the stream ASN.1 types. The UNIVERSAL tag value and length is also encoded if explicit tagging is specified (the universal identifier must be provided by the caller).
Throws, exception thrown by the underlying System.IO.Stream object.
type | The object to be written |
explicitTagging | Flag indicating explicit tagging should be done |
Reimplemented in Asn1CerOutputStream.
References Asn1Type.Encode().
|
virtual |
This method writes the given array of bytes as bit string value.
Throws, exception thrown by the underlying System.IO.Stream object.
data | Byte array containing data to encode. |
numbits | Number of bits to encode |
explicitTagging | Flag indicating explicit tagging should be done |
tag | Universal tag to apply |
Asn1Exception | Thrown, if operation is failed. |
Reimplemented in Asn1CerOutputStream.
Referenced by Asn1BitString.ToString().
|
virtual |
This method writes the given string as BMP string value.
Throws, exception thrown by the underlying System.IO.Stream object.
data | String containing data to encode. |
explicitTagging | Flag indicating explicit tagging should be done |
tag | Universal tag to apply |
Asn1Exception | Thrown, if operation is failed. |
Reimplemented in Asn1CerOutputStream.
Referenced by Asn1BMPString.Encode().
|
virtual |
This method encodes and writes to the stream an ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. The UNIVERSAL tag value and length is also encoded if explicit tagging is specified (the universal identifier must be provided by the caller).
Throws, exception thrown by the underlying System.IO.Stream object.
data | The string object to be written |
explicitTagging | Flag indicating explicit tagging should be done |
tag | Universal tag to apply |
Asn1Exception | Thrown, if operation is failed. |
Reimplemented in Asn1CerOutputStream.
References Asn1Util.ToByteArray().
Referenced by Asn1IA5String.Asn1IA5String(), Asn1Time.Asn1Time(), Asn1ObjectDescriptor.Encode(), Asn1GraphicString.Encode(), Asn1VideotexString.Encode(), Asn1VisibleString.Encode(), Asn1GeneralString.Encode(), Asn1T61String.Encode(), Asn1PrintableString.Encode(), Asn1Duration.Encode(), Asn1TimeOfDay.Encode(), Asn1Date.Encode(), Asn1DateTime.Encode(), Asn1NumericString.Encode(), and Asn1AbstractTime.Encode().
|
virtual |
This method encodes and writes an End-Of-Contents marker to the stream.
Throws, exception thrown by the underlying System.IO.Stream object.
|
virtual |
This method encodes and writes to the stream an ASN.1 identifier value such as the ones used in a tags or object identifiers.
Throws, exception thrown by the underlying System.IO.Stream.
ident | The identifier to be encoded. |
References Asn1Util.URShift().
Referenced by Asn1RelativeOID.DecodeXML(), and Asn1ObjectIdentifier.ToString().
|
virtual |
This method encodes and writes to the stream an ASN.1 integer value's contents according to the ASN.1 Basic Encoding Rules (BER).
Throws, exception thrown by the underlying System.IO.Stream object.
data | Integer value to encode. |
encodeLen | Flag indicating length determinant should be encoded before encoding integer value. |
References Diag.Prtln().
Referenced by Asn1X694OrderElement.Encode(), Asn1Real.NormalizedRealValueToString(), Asn1Enumerated.ToString(), and Asn1Integer.ToString().
|
virtual |
This method encodes and writes a length value to the stream.
Throws, exception thrown by the underlying System.IO.Stream object.
len | The length to be encoded. |
References Asn1Util.GetBytesCount(), and Asn1Status.INDEFLEN.
Referenced by Asn1RelativeOID.DecodeXML(), Asn1BigInteger.DecodeXML(), Asn1UTF8String.Encode(), Asn1Real.NormalizedRealValueToString(), Asn1Null.ToString(), Asn1Boolean.ToString(), and Asn1ObjectIdentifier.ToString().
|
virtual |
This method writes the given array of bytes as octet string value.
Throws, exception thrown by the underlying System.IO.Stream object.
data | Byte array containing data to encode. |
explicitTagging | Flag indicating explicit tagging should be done |
tag | Universal tag to apply |
Asn1Exception | Thrown, if operation is failed. |
Reimplemented in Asn1CerOutputStream.
Referenced by Asn1OctetString.ToString().
|
virtual |
This method encodes and writes a tag value to the stream.
Throws, exception thrown by the underlying System.IO.Stream object.
tag | The tag to be encoded. |
References Asn1Tag.EXTIDCODE, Asn1Tag.mClass, Asn1Tag.mForm, and Asn1Tag.mIDCode.
Referenced by Asn1RelativeOID.DecodeXML(), Asn1BigInteger.DecodeXML(), Asn1X694OrderElement.Encode(), Asn1UTF8String.Encode(), Asn1Real.NormalizedRealValueToString(), Asn1Null.ToString(), Asn1Enumerated.ToString(), Asn1Boolean.ToString(), Asn1ObjectIdentifier.ToString(), and Asn1Integer.ToString().
|
virtual |
This method encodes and writes a tag value to the stream.
Throws, exception thrown by the underlying System.IO.Stream object.
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. |
|
virtual |
This method encodes and writes both a tag and an indefinite length indicator to the stream.
Throws, exception thrown by the underlying System.IO.Stream object.
tag | The tag to be encoded. |
|
virtual |
This overloaded version of EncodeTagAndIndefLen allows tag value components to be specified instead of an Asn1Tag object.
Throws, exception thrown by the underlying System.IO.Stream object.
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. |
|
virtual |
This method encodes and writes both a tag and length value to the stream.
Throws, exception thrown by the underlying System.IO.Stream object.
tag | The tag to be encoded. |
len | The length to be encoded. |
Referenced by Asn1Real10.ConvertToDecimal(), and Asn1Real10.Encode().
|
virtual |
This method writes the given array of integers as UniversalString value.
Throws, exception thrown by the underlying System.IO.Stream object.
data | Array containing data to encode. |
explicitTagging | Flag indicating explicit tagging should be done |
tag | Universal tag to apply |
Asn1Exception | Thrown, if operation is failed. |
Reimplemented in Asn1CerOutputStream.
References Asn1Util.URShift().
Referenced by Asn1UniversalString.ToString().
|
virtual |
This method encodes an integer value as unsigned binary number according to the ASN.1 Basic Encoding Rules (BER).. and writes to the stream
Throws, exception thrown by the underlying System.IO.Stream object.
data | Integer value to encode. |
References Diag.Prtln().
Referenced by Asn1Real.NormalizedRealValueToString().