ASN1BERDecodeStream Class Reference
[C++ classes for streaming BER decoding.]
#include <ASN1BERDecodeStream.h>
Detailed Description
This class is a base class for other ASN.1 BER input stream's classes. It is derived from the ASN1Stream base class. It contains variables and methods specific to streaming decoding of BER messages. It is used to manage the input stream containing the ASN.1 message to be decoded.
Public Member Functions | |
| ASN1BERDecodeStream (OSRTInputStreamIF &is) | |
| ASN1BERDecodeStream (OSRTInputStreamIF *pis, OSBOOL bOwnStream=TRUE) | |
| virtual void * | getAppInfo () |
| virtual OSRTCtxtPtr | getContext () |
| virtual OSCTXT * | getCtxtPtr () |
| virtual char * | getErrorInfo () |
| virtual char * | getErrorInfo (char *pBuf, size_t &bufSize) |
| virtual int | getStatus () const |
| virtual void | printErrorInfo () |
| virtual void | resetErrorInfo () |
| virtual void | setAppInfo (void *pAppInfo) |
| virtual void | setDiag (OSBOOL value=TRUE) |
| virtual int | close () |
| virtual int | flush () |
| virtual OSBOOL | isOpened () |
| virtual size_t | currentPos () |
| virtual OSBOOL | markSupported () |
| int | mark (size_t readAheadLimit) |
| virtual long | read (OSOCTET *pDestBuf, size_t maxToRead) |
| virtual long | readBlocking (OSOCTET *pDestBuf, size_t toReadBytes) |
| int | reset () |
| virtual int | skip (size_t n) |
| ASN1BERDecodeStream & | operator>> (ASN1CType &val) |
| size_t | byteIndex () |
| OSBOOL | chkend (ASN1CCB &ccb) |
| int | decodeBigInt (const char *&pval, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeBitStr (OSOCTET *pbits, OSUINT32 &numbits, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeBitStr (ASN1DynBitStr &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeBMPStr (Asn116BitCharString &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeBool (OSBOOL &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeCharStr (const char *&pval, ASN1TagType tagging=ASN1EXPL, ASN1TAG tag=0, int length=0) |
| int | decodeEnum (OSINT32 &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeEoc () |
| int | decodeInt (OSINT32 &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeInt8 (OSINT8 &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeInt16 (OSINT16 &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeInt64 (OSINT64 &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeLength (OSINT32 &length) |
| int | decodeNull (ASN1TagType tagging=ASN1EXPL) |
| int | decodeObj (ASN1CType &val) |
| int | decodeObjId (ASN1OBJID &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeObjId64 (ASN1OID64 &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeOctStr (OSOCTET *pocts, OSUINT32 &numocts, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeOctStr (ASN1DynOctStr &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeOpenType (ASN1OpenType &val) |
| int | decodeReal (OSREAL &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeRelativeOID (ASN1OBJID &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeTag (ASN1TAG &tag) |
| int | decodeTagAndLen (ASN1TAG &tag, OSINT32 &len) |
| int | decodeUInt (OSUINT32 &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeUInt8 (OSUINT8 &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeUInt16 (OSUINT16 &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeUInt64 (OSUINT64 &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | decodeUnivStr (Asn132BitCharString &val, ASN1TagType tagging=ASN1EXPL, int length=0) |
| int | getTLVLength () |
| OSBOOL | isA (int bufferType) |
| int | peekTagAndLen (ASN1TAG &tag, int &len) |
| int | readTLV (OSOCTET *pDestBuf, size_t bufsiz) |
Protected Attributes | |
| OSRTInputStreamIF * | mpStream |
| OSBOOL | mbOwnStream |
Constructor & Destructor Documentation
|
|
A default constructor. Use getStatus() method to determine has error occured during the initialization or not. |
Member Function Documentation
|
|
This method returns the total number of octets (bytes) already decoded from the stream.
|
|
|
This method determines if the decoder has reached the end of a message context block. This method could be called when decoding a SET or SEQUENCE OF/SET OF construct.
|
|
|
Closes the input or output stream and releases any system resources associated with the stream. For output streams this function also flushes all internal buffers to the stream.
|
|
|
This method returns the current position in the stream (in octets).
|
|
||||||||||||||||
|
This method decodes a variable of the ASN.1 INTEGER type. In this case, the integer is assumed to be of a larger size than can fit in a C or C++ long type (normally 32 or 64 bits).
|
|
||||||||||||||||
|
This method decodes a variable of the ASN.1 BIT STRING type. It will allocate dynamic memory to store the decoded result.
|
|
||||||||||||||||||||
|
This method decodes a variable of the ASN.1 BIT STRING type into a static memory structure. It is used to decode a sized bit string production.
|
|
||||||||||||||||
|
This method decodes a variable of the ASN.1 BMPString type.
|
|
||||||||||||||||
|
This method decodes a variable of the ASN.1 BOOLEAN type.
|
|
||||||||||||||||||||
|
This method decodes a variable of one of the ASN.1 8-bit character string types. These types include IA5String, VisibleString, PrintableString, and NumericString.
|
|
||||||||||||||||
|
This method decodes a variable of the ASN.1 ENUMERATED type.
|
|
|
This method decodes the end-of-contents octets.
|
|
||||||||||||||||
|
This method decodes a variable of the ASN.1 INTEGER type.
|
|
||||||||||||||||
|
This method decodes a 16-bit variable of the ASN.1 INTEGER type.
|
|
||||||||||||||||
|
This method decodes a 64-bit variable of the ASN.1 INTEGER type.
|
|
||||||||||||||||
|
This method decodes an 8-bit variable of the ASN.1 INTEGER type.
|
|
|
This method decodes a BER length determinant value.
|
|
|
This method decodes a variable of the ASN.1 NULL type.
|
|
|
This method decodes an ASN.1 constructed object from the stream.
|
|
||||||||||||||||
|
This method decodes a variable of the ASN.1 OBJECT IDENTIFIER type.
|
|
||||||||||||||||
|
This method decodes a variable of the ASN.1 OBJECT IDENTIFIER type using 64-bit subidentifiers..
|
|
||||||||||||||||
|
This method decodes a variable of the ASN.1 OCTET STRING type. It will allocate dynamic memory to store the decoded result.
|
|
||||||||||||||||||||
|
This method decodes a variable of the ASN.1 OCTET STRING type into a static memory structure. It is used to decode a sized octet string production.
|
|
|
This method decodes an ASN.1 open type value. This is a value of any ASN.1 data type. It may be constructed and contain multiple elements including elements encoded with indefinite lengths. This method will allocate dynamic memory to store the decoded result.
|
|
||||||||||||||||
|
This method decodes a variable of the ASN.1 REAL type.
|
|
||||||||||||||||
|
This method decodes a variable of the ASN.1 RELATIVE-OID type.
|
|
|
This method decodes the tag at the current decode pointer location and returns the results.
|
|
||||||||||||
|
This method decodes the tag and length at the current decode pointer location and returns the results.
|
|
||||||||||||||||
|
This method decodes a variable of the unsigned variant of ASN.1 INTEGER type.
|
|
||||||||||||||||
|
This method decodes a 16-bit variable of the unsigned variant of ASN.1 INTEGER type.
|
|
||||||||||||||||
|
This method decodes a 64-bit variable of the unsigned variant of ASN.1 INTEGER type.
|
|
||||||||||||||||
|
This method decodes an 8-bit variable of the unsigned variant of ASN.1 INTEGER type.
|
|
||||||||||||||||
|
This method decodes a variable of the ASN.1 UniversalString type.
|
|
|
Flushes the buffered data to the stream.
|
|
|
Returns a pointer to application-specific information block |
|
|
The getContext method returns the underlying context smart-pointer object.
|
|
|
The getCtxtPtr method returns the underlying C runtime context. This context can be used in calls to C runtime functions.
|
|
||||||||||||
|
Returns error text in a memory buffer. If buffer pointer is specified in parameters (not NULL) then error text will be copied in the passed buffer. Otherwise, this method allocates memory using the 'operator new []' function. The calling routine is responsible to free the memory by using 'operator delete []'.
|
|
|
Returns error text in a dynamic memory buffer. The buffer will be allocated by 'operator new []'. The calling routine is responsible to free the memory by using 'operator delete []'.
|
|
|
This method returns the completion status of previous operation. It can be used to check completion status of constructors or methods, which do not return completion status. If error occurs, use printErrorInfo method to print out the error's description and stack trace. Method resetError can be used to reset error to continue operations after recovering from the error.
|
|
|
Get the total length of a tag-length-value (TLV) component. This is not the length stored in the L field. It is the total length of the component which is equal to the parsed length plus the number of bytes in the tag and length fields.
|
|
|
This method matches an enumerated identifier defined in the base class. One identifier is declared for each of the derived classes.
|
|
|
Checks, is the stream opened or not.
|
|
|
This method marks the current position in this input stream. A subsequent call to the ASN1BERDecodeStream::reset method repositions this stream at the last marked position so that subsequent reads re-read the same bytes. The readAheadLimit argument tells this input stream to allow that many bytes to be read before the mark position gets invalidated.
|
|
|
Tests if this input stream supports the mark and reset methods. Whether or not mark and reset are supported is an invariant property of a particular input stream instance. By default, it returns FALSE.
|
|
|
Decodes an ASN.1 constructed object from the stream. Use getStatus() method to determine has error occured during the operation or not.
|
|
||||||||||||
|
This method "peeks" the tag and length at the current decode pointer location and returns the results. The decode pointer location is left as it was before call to this function.
|
|
|
The printErrorInfo method prints information on errors contained within the context. |
|
||||||||||||
|
Read data from the stream. This method reads up to
|
|
||||||||||||
|
Read data from the stream. This method reads
|
|
||||||||||||
|
Read a complete tag-length-value (TLV) from the decode stream into the given memory buffer.
|
|
|
Repositions this stream to the position at the time the mark method was last called on this input stream.
|
