ASN1C C# Runtime Library
7.6
|
Public Member Functions | |
Asn1BerDecodeBuffer (byte[] msgdata) | |
Asn1BerDecodeBuffer (System.IO.Stream istream) | |
int | DecodeEnumValue (bool explicitTagging, int implicitLength) |
int | DecodeEnumValue (Asn1Tag tag, bool explicitTagging, int implicitLength) |
virtual int | DecodeLength () |
virtual byte [] | DecodeOpenType () |
virtual byte [] | DecodeOpenType (bool saveData) |
virtual void | DecodeTag (Asn1Tag tag) |
virtual int | DecodeTagAndLength (Asn1Tag tag) |
System.Exception | HandleException (Asn1Exception e) |
virtual bool | MatchTag (short tagClass, short tagForm, int tagIDCode, Asn1Tag parsedTag, IntHolder parsedLen) |
virtual bool | MatchTag (Asn1Tag tag, Asn1Tag parsedTag, IntHolder parsedLen) |
virtual bool | MatchTag (Asn1Tag tag) |
virtual void | Parse (Asn1TaggedEventHandler handler) |
virtual void | PeekTag (Asn1Tag parsedTag) |
virtual Asn1Tag | PeekTag () |
override int | ReadByte () |
void | SetExceptionHandler (Asn1BerExceptionHandler handler) |
void | SkipTLV () |
void | ThrowIfUnhandled (Asn1Exception e) |
Public Member Functions inherited from Asn1DecodeBuffer | |
virtual void | AddCaptureBuffer (System.IO.MemoryStream buffer) |
virtual void | Capture (int nbytes) |
virtual long | DecodeIntValue (int length, bool signExtend) |
virtual int [] | DecodeOIDContents (int llen) |
virtual int [] | DecodeRelOIDContents (int llen) |
override System.IO.Stream | GetInputStream () |
virtual void | HexDump () |
virtual void | Mark () |
virtual void | MarkPos (ref BufferPos bufferPos) |
virtual int | Read () |
virtual void | Read (byte[] buffer, int offset, int nbytes) |
virtual void | Read (byte[] buffer) |
int | Read2Bytes () |
int | Read4Bytes () |
virtual void | RemoveCaptureBuffer (System.IO.MemoryStream buffer) |
virtual void | Reset () |
virtual void | ResetPos (ref BufferPos bufferPos) |
virtual void | SetInputStream (byte[] msgdata, int offset, int length) |
virtual long | Skip (long nbytes) |
Public Member Functions inherited from Asn1MessageBuffer | |
virtual void | AddNamedEventHandler (Asn1NamedEventHandler handler) |
virtual void | InvokeCharacters (System.String svalue) |
virtual void | InvokeEndElement (System.String name, int index) |
virtual void | InvokeStartElement (System.String name, int index) |
Public Member Functions inherited from Asn1MessageBufferBase | |
void | SetKey (byte[] rtkey) |
void | SetPermanentKey (byte[] rtkey) |
Static Public Member Functions | |
static int | CalcIndefLen (byte[] data, int offset, int len) |
Static Public Member Functions inherited from Asn1MessageBufferBase | |
static void | HexDump (System.IO.Stream ins, System.IO.StreamWriter outs) |
static void | HexDump (System.IO.Stream ins) |
Properties | |
virtual Asn1Tag | LastTag [get] |
Properties inherited from Asn1DecodeBuffer | |
virtual int | ByteCount [get] |
bool | LazyOpenTypeDecode [get, set] |
Properties inherited from Asn1MessageBuffer | |
virtual Asn1MessageBuffer | EventHandlerList [set] |
Properties inherited from Asn1MessageBufferBase | |
Asn1Context | Context [get] |
virtual short | TypeCode [set] |
This class handles the decoding of ASN.1 messages as specified in the Basic Encoding Rules (BER) as documented in the ITU-T X.690 standard.
Asn1BerDecodeBuffer | ( | byte [] | msgdata | ) |
This constructor creates a BER Decode buffer object that references an encoded ASN.1 message.
msgdata | Byte array containing an encoded ASN.1 message. |
Asn1BerDecodeBuffer | ( | System.IO.Stream | istream | ) |
This constructor creates a BER Decode buffer object that references an encoded ASN.1 message. In this case, the message is passed in using an System.IO.Stream object.
istream | Input stream containing an encoded ASN.1 message. |
|
static |
This function calculates the actual length of an indefinite length message component.
data | Buffer with the indefinite length message component. |
offset | The start offset in the array |
len | Length of the buffer (begining from the offset) |
References Asn1DecodeBuffer.ByteCount, Asn1BerDecodeBuffer.DecodeTagAndLength(), Asn1Status.INDEFLEN, Asn1Tag.IsEOC(), and Asn1DecodeBuffer.Skip().
int DecodeEnumValue | ( | bool | explicitTagging, |
int | implicitLength | ||
) |
This method decodes an enumerated value from the buffer.
explicitTagging | A flag that indicates the element is explicitly tagged. |
implicitLength | The length of the contents if implicitly tagged. |
References Asn1Type.ENUMERATED, IntHolder.mValue, Asn1Tag.PRIM, and Asn1Tag.UNIV.
int DecodeEnumValue | ( | Asn1Tag | tag, |
bool | explicitTagging, | ||
int | implicitLength | ||
) |
This method decodes an enumerated value from the buffer.
tag | An Asn1Tag value for enumerated values that are tagged other than UNIVERSAL 10. |
explicitTagging | A flag that indicates the element is explicitly tagged. |
implicitLength | The length of the contents if implicitly tagged. |
References Asn1Tag.CONS, Asn1Type.ENUMERATED, Asn1Tag.mForm, and IntHolder.mValue.
|
virtual |
This method decodes a length value.
References Asn1Status.INDEFLEN, Asn1Tag.L7BitsMask, and Diag.Prtln().
|
virtual |
This method decodes an ASN.1 BER open type value. This is a fully encoded message component of any type. The component is captured in the Decode capture buffer and a reference to a byte array is returned containing the component.
Referenced by Asn1OpenType.GetDataEncoding().
|
virtual |
This method decodes an ASN.1 BER open type value. This is a fully encoded message component of any type. This version of the method allows the option of saving or discarding the open type data.
saveData | True if data should be captured and returned |
|
virtual |
This method decodes a tag value.
tag | Tag object to receive decoded tag fields. |
References Asn1Tag.Bit8Mask, Asn1Tag.ClassMask, Asn1Tag.EXTIDCODE, Asn1Tag.FormMask, Asn1Tag.IDMask, Asn1Tag.L7BitsMask, Asn1Tag.mClass, Asn1Tag.mForm, Asn1Tag.mIDCode, Diag.Prtln(), and Asn1Tag.ToString().
|
virtual |
This method decodes a tag and length value.
tag | Tag object to receive decoded tag fields. |
Referenced by Asn1BerDecodeBuffer.CalcIndefLen().
System.Exception HandleException | ( | Asn1Exception | e | ) |
If this buffer has an exception handler set, this will return handler.handleException(e, ctxt). Otherwise, this will return e. /p>
References Asn1BerExceptionHandler.HandleException().
|
virtual |
This method decodes the next tag value and checks for a match with the given tag value. If the match is successful, the Decode cursor will be psoitioned at the contents field; otherwise, it will be reset to point to the start of the tag field.
tagClass | Class value of tag to match |
tagForm | Form value of tag to match |
tagIDCode | ID code of tag to match |
parsedTag | Holder object to receive parsed tag value |
parsedLen | Holder object to receive parsed length value |
References Asn1Tag.Equals(), and IntHolder.mValue.
Referenced by Asn1Type._SetLicLocation(), Asn1BerDecodeContext.Expired(), and Asn1BerDecodeContext.MatchElemTag().
This overloaded version of MatchTag allows the tag value to be matched to be passed using an Asn1Tag object.
tag | Tag value to be matched. |
parsedTag | Holder object to receive parsed tag value |
parsedLen | Holder object to receive parsed length value |
References Asn1Tag.mClass, Asn1Tag.mForm, and Asn1Tag.mIDCode.
|
virtual |
This overloaded version of MatchTag will just test for a match and not return parsed tag and length values
tag | Tag value to be matched. |
References Asn1Tag.mClass, Asn1Tag.mForm, and Asn1Tag.mIDCode.
|
virtual |
This method parses the complete message and invokes the event handler callback methods as various items are encountered.
handler | Object implementing the Asn1EventHandler interface. |
References Asn1Tag.Constructed, Asn1TaggedEventHandler.Contents(), Asn1TaggedEventHandler.EndElement(), Asn1Status.INDEFLEN, Asn1Tag.IsEOC(), IntHolder.mValue, and Asn1TaggedEventHandler.StartElement().
Referenced by Asn1BerEncodeBuffer.EncodeTagAndLength().
|
virtual |
This method will Parse and return the next tag in the Decode stream without advancing the Decode cursor.
parsedTag | Holder object to receive parsed tag value |
|
virtual |
This overloaded version of the PeekTag method will return a reference to a newly created tag object.
|
virtual |
This 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.
Implements Asn1DecodeBuffer.
void SetExceptionHandler | ( | Asn1BerExceptionHandler | handler | ) |
Set an exception handler on this buffer. /p>
handler | Your exception handler or null. |
void SkipTLV | ( | ) |
This method skips a TLV (tag, length, value) in the encoding. /p>
void ThrowIfUnhandled | ( | Asn1Exception | e | ) |
Throw the given exception, unless an exception handler is set and it the handler handles it. /p>
e | The exception<param> |
References Asn1Status.INDEFLEN, Asn1Tag.IsEOC(), and IntHolder.mValue.
|
get |
Gets the last tag parsed within this decode buffer object.
Value:
Last parsed tag object reference
Referenced by Asn1BitString.Clear(), Asn1OctetString.CompareTo(), Asn1BMPString.Decode(), Asn1UniversalString.Decode(), and Asn1CharString.validate().