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
00031
00032
00033
#ifndef CTTLV_H
00034
#define CTTLV_H
00035
00036
class CTTLV;
00037
class CTTLV_FCI;
00038
00039 #define k_CTTLV_CLASS_UNIVERSAL 0x00
00040 #define k_CTTLV_CLASS_APPLICATION 0x40
00041 #define k_CTTLV_CLASS_CONTEXT 0x80
00042 #define k_CTTLV_CLASS_PRIVATE 0xc0
00043 #define k_CTTLV_TYPE_CONSTRUCTED 0x20
00044
00045
00046
#include <string>
00047
00048
00049
00060 class CHIPCARD_API CTTLV {
00061
private:
00062
unsigned int _type;
00063
unsigned int _tag;
00064
unsigned int _length;
00065 string _value;
00066
unsigned int _size;
00067
bool _valid;
00068
bool _simple;
00069
00070
public:
00071 CTTLV();
00072
00083 CTTLV(
const string &s,
unsigned int &pos,
bool simple=
false);
00084
00091 CTTLV(
unsigned int tag,
unsigned int cl,
bool cstrc,string d);
00092
00098 CTTLV(
unsigned int tag, string d);
00099 ~CTTLV();
00100 unsigned int getTag()
const {
return _tag;};
00101 unsigned int getLength()
const {
return _length;};
00102 string getValue()
const {
return _value;};
00103 unsigned int getSize()
const {
return _size;};
00104 bool isValid()
const {
return _valid;};
00105
00111 bool isConstructed()
const {
return _type &0x20;};
00112
00113 bool isSimple()
const {
return _simple;};
00114
00119 unsigned int getClass()
const {
return _type & 0xc0;};
00120
00124 string toString();
00125
00126 };
00127
00128
00129
00133 class CHIPCARD_API CTTLV_FCI {
00134
private:
00135
protected:
00140
virtual void parseTag(
CTPointer<CTTLV> tag);
00141
public:
00142 unsigned int fileSize;
00143 unsigned int fileSizeRaw;
00144 unsigned int fileId;
00145 string fileType;
00146 bool isEF;
00147 string fileDescription;
00148 string fileAttributes;
00149 unsigned int maxRecordLength;
00150 string fileName;
00151 bool isTransparent;
00152 bool isLinear;
00153 bool isFixed;
00154 bool isVariable;
00155 bool isCyclic;
00156 bool isSimpleTLV;
00157
00164 CTTLV_FCI(string fci);
00165
00166 CTTLV_FCI();
00167
virtual ~CTTLV_FCI();
00168
00169
00170
00171 };
00172
00173
00174
00175
00176
#endif
00177
00178
00179
00180
00181
00182