|
|
 |
 |
|
Asn1DecodeBuffer Class ReferenceInheritance diagram for Asn1DecodeBuffer:
List of all members.
Detailed Description
This is the base class to specific Decode buffer classes for the different types of encoding rules (BER, DER and PER).
Member Function Documentation
| virtual void AddCaptureBuffer |
( |
System.IO.MemoryStream |
buffer |
) |
[virtual] |
|
|
|
This method is used to add a capture buffer to the internal capture buffer list. A capture buffer is used to capture all bytes read from this position forward from the input stream.
- Parameters:
-
| buffer | Buffer into which captured bytes are to be stored |
|
|
|
This method adds a named event handler to the named event handler list for this buffer.
- Parameters:
-
|
| virtual void Capture |
( |
int |
nbytes |
) |
[virtual] |
|
|
|
This method captures bytes from the input stream to a separate object for later analysis.
- Parameters:
-
| nbytes | Number of bytes to capture |
|
| virtual long DecodeIntValue |
( |
int |
length, |
|
|
bool |
signExtend |
|
) |
[virtual] |
|
|
|
This method decodes the contents of an ASN.1 integer value. It can be used for either BER or PER decoding.
- Parameters:
-
| length | Length of encoded contents |
| signExtend | Sign-extend the decoded value to form a 2's comp result |
- Returns:
- Decoded long integer value
|
| virtual int [] DecodeOIDContents |
( |
int |
llen |
) |
[virtual] |
|
|
|
This method decodes the contents of an ASN.1 object identifier value. It can be used for either BER or PER decoding.
- Parameters:
-
| llen | Length of encoded contents |
- Returns:
- Decoded object identifier value
|
| virtual int [] DecodeRelOIDContents |
( |
int |
llen |
) |
[virtual] |
|
|
|
This method decodes the contents of an ASN.1 relative object identifier value. It can be used for either BER or PER decoding.
- Parameters:
-
| llen | Length of encoded contents |
- Returns:
- Decoded object identifier value
|
| override System.IO.Stream GetInputStream |
( |
|
) |
[virtual] |
|
|
|
This method returns a reference to the current current Decode input stream object.
- Returns:
- New input stream object containing encoded message
Implements Asn1MessageBuffer. |
| virtual void HexDump |
( |
|
) |
[virtual] |
|
|
|
This method provides a hex dump of the bytes in the message being decoded. |
| virtual internal void Init |
( |
|
) |
[protected, virtual] |
|
|
|
This method initializes the input stream for decoding. |
| virtual void InvokeCharacters |
( |
System.String |
svalue |
) |
[virtual] |
|
|
|
This method is used by the event handling logic to invoke the 'characters' event handling method when message contents are parsed.
- Parameters:
-
| svalue | Stringified representation of a parsed value field |
|
| virtual void InvokeEndElement |
( |
System.String |
name, |
|
|
int |
index |
|
) |
[virtual] |
|
|
|
This method is used by the event handling logic to invoke the 'endElement' event handling method when parsing of an element within a message is completed.
- Parameters:
-
| name | Name of the element |
| index | Index of element if SEQUENCE OF or SET OF element |
|
| virtual void InvokeStartElement |
( |
System.String |
name, |
|
|
int |
index |
|
) |
[virtual] |
|
|
|
This method is used by the event handling logic to invoke the 'StartElement' event handling method when parsing of an element within a message is started.
- Parameters:
-
| name | Name of the element |
| index | Index of element if SEQUENCE OF or SET OF element |
|
| virtual void Mark |
( |
|
) |
[virtual] |
|
| virtual void Read |
( |
byte[] |
buffer |
) |
[virtual] |
|
|
|
This version of the read method reads the number of bytes equal to the length of the given input buffer.
Throws, Exception thrown by C# System.IO.Stream for I/O error, for Stream as input data - Parameters:
-
| buffer | the buffer into which the data is read |
- Exceptions:
-
|
| virtual void Read |
( |
byte[] |
buffer, |
|
|
int |
offset, |
|
|
int |
nbytes |
|
) |
[virtual] |
|
|
|
This version of the read method reads the given number of bytes from the current input stream and writes them to the specified byte array at the given offset. It also writes the data to all registered capture buffers.
Throws, Exception thrown by C# System.IO.Stream for I/O error for Stream as input data - Parameters:
-
| buffer | the buffer into which the data is read |
| offset | the start offset of the data |
| nbytes | number of bytes to read |
- Exceptions:
-
|
| virtual int Read |
( |
|
) |
[virtual] |
|
|
|
The read method reads a single byte from the current input stream and returns it to the caller. It will also write the byte out to all registered capture buffers.
Throws, Exception thrown by C# System.IO.Stream for I/O error for Stream as input data - Returns:
- byte that was read from the input stream
- Exceptions:
-
|
| abstract int ReadByte |
( |
|
) |
[pure virtual] |
|
|
|
This abstract method returns the next available 8-bit value from the input stream. It is implemented differently for BER/DER and PER to take into account odd alignments in PER.
- Returns:
- Next 8-bit byte value from input stream
Implemented in Asn1BerDecodeBuffer, and Asn1PerDecodeBuffer. |
| virtual void RemoveCaptureBuffer |
( |
System.IO.MemoryStream |
buffer |
) |
[virtual] |
|
|
|
This method is used to remove a capture buffer from the internal capture buffer list. The add and remove methods can be used to get a set of raw bytes from the input stream for further processing.
- Parameters:
-
| buffer | Buffer in which captured bytes stored |
|
| virtual void Reset |
( |
|
) |
[virtual] |
|
| virtual void SetInputStream |
( |
byte[] |
msgdata, |
|
|
int |
offset, |
|
|
int |
length |
|
) |
[virtual] |
|
|
|
This method will set the input stream from which data is read. This version of the method allows a byte array containing encoded data to be specified.
- Parameters:
-
| msgdata | Byte array containing encoded message data |
| offset | Starting offset of data in the byte array |
| length | Length (in bytes) of the encoded data |
Reimplemented in Asn1PerDecodeBuffer. |
| virtual long Skip |
( |
long |
nbytes |
) |
[virtual] |
|
Member Data Documentation
|
|
This member variable holds the count of bytes currently read from the message being decoded or input stream. |
Property Documentation
virtual int ByteCount [get] |
|
|
|
Gets the count of bytes currently read from the message being decoded or input stream. |
|
|
Sets the event handler list in this object to be equal to that in the given Decode buffer object.
Value: Decode buffer object |
virtual short TypeCode [set] |
|
|
|
Sets the internal type code to the given value. This is a code describing the last type parsed by the decoder.
Value: Type code (codes are defined in Asn1Type.cs). The codes correspond to the UNIVERSAL tag ID values for the built-in types. |
|
This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.
|
This file was last modified on
18 Nov 2005. ASN1C C# Runtime Library, 5.8 |
|