00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00032
00037
#ifndef _ASN1PERCPPTYPES_H_
00038
#define _ASN1PERCPPTYPES_H_
00039
00040
extern "C" {
00041
#include "asn1per.h"
00042 }
00043
#include "asn1CppTypes.h"
00044
00061
00070 class EXTERNPER ASN1PERMessageBuffer :
public ASN1MessageBuffer {
00071
protected:
00072
00083 ASN1PERMessageBuffer (Type bufferType, ASN1BOOL aligned);
00084
00085
00099 ASN1PERMessageBuffer (Type bufferType, ASN1OCTET* pMsgBuf,
00100 size_t msgBufLen, ASN1BOOL aligned);
00101
public:
00102
00109 inline void binDump (
const char* varname) {
00110
pu_bindump (mpContext->getPtr(), (
char*)varname);
00111 }
00112
00119 inline void hexDump () {
00120
pu_hexdump (mpContext->getPtr());
00121 }
00122
00128 inline size_t getMsgLen () {
00129
return pu_getMsgLen (mpContext->getPtr());
00130 }
00131
00141 inline void setTrace (ASN1BOOL value) {
00142
pu_setTrace (mpContext->getPtr(), value);
00143 }
00144
00162
int setBuffer (
const ASN1OCTET* pMsgBuf, size_t msgBufLen);
00163
00164
00165
inline void BinDump (
const char* varname) { binDump (varname); }
00166
inline void HexDump () { hexDump (); }
00167
inline int GetMsgLen () {
return (
int)getMsgLen (); }
00168
inline void SetTrace (ASN1BOOL value) { setTrace (value); }
00169 } ;
00170
00171
00178 class EXTERNPER ASN1PEREncodeBuffer :
public ASN1PERMessageBuffer {
00179
public:
00189 ASN1PEREncodeBuffer (ASN1BOOL aligned) :
00190 ASN1PERMessageBuffer (PEREncode, aligned) {}
00191
00204 ASN1PEREncodeBuffer (ASN1OCTET* pMsgBuf, size_t msgBufLen, ASN1BOOL aligned)
00205 : ASN1PERMessageBuffer (PEREncode, pMsgBuf, msgBufLen, aligned) {}
00211 inline size_t getMsgBitCnt () {
00212
return pe_GetMsgBitCnt (mpContext->getPtr());
00213 }
00214
00224
virtual ASN1OCTET* getMsgCopy ();
00225
00231
virtual const ASN1OCTET* getMsgPtr ();
00232
00244
int init ();
00245
00255 virtual ASN1BOOL isA (Type bufferType) {
00256
return bufferType == PEREncode;
00257 }
00258
00259
00260
inline int GetMsgBitCnt () {
return (
int)getMsgBitCnt(); }
00261
00262 } ;
00263
00264
00273 class EXTERNPER ASN1PERDecodeBuffer :
public ASN1PERMessageBuffer {
00274
public:
00282 ASN1PERDecodeBuffer (ASN1BOOL aligned) :
00283 ASN1PERMessageBuffer (PERDecode, aligned)
00284 {}
00285
00296 ASN1PERDecodeBuffer (
const ASN1OCTET* pMsgBuf,
00297 size_t msgBufLen, ASN1BOOL aligned) :
00298 ASN1PERMessageBuffer (PERDecode, (ASN1OCTET*)pMsgBuf, msgBufLen, aligned)
00299 {}
00300
00309 ASN1PERDecodeBuffer (
const char* filePath, ASN1BOOL aligned);
00310
00320 virtual ASN1BOOL isA (Type bufferType) {
00321
return bufferType == PERDecode;
00322 }
00323
00333
int readBinaryFile (
const char* filePath);
00334 } ;
00335
00336
00343
#endif
00344
00345
00346