eID middleware |

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# eidlib.h

Go to the documentation of this file.

    00001 /* ****************************************************************************
    00002  * eID Middleware Project.
    00003  * Copyright (C) 2008-2009 FedICT.
    00004  *
    00005  * This is free software; you can redistribute it and/or modify it
    00006  * under the terms of the GNU Lesser General Public License version
    00007  * 3.0 as published by the Free Software Foundation.
    00008  *
    00009  * This software is distributed in the hope that it will be useful,
    00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    00012  * Lesser General Public License for more details.
    00013  *
    00014  * You should have received a copy of the GNU Lesser General Public
    00015  * License along with this software; if not, see
    00016  * http://www.gnu.org/licenses/.
    00017 **************************************************************************** */
    00018 #pragma once
    00019
    00020 #ifndef __PTEIDLIB_H__
    00021 #define __PTEIDLIB_H__
    00022
    00023 #include <string>
    00024 #include <vector>
    00025 #include <map>
    00026 #include "eidlibdefines.h"
    00027
    00028 namespace eIDMW
    00029 {
    00030
    00031 struct SDK_Context;
    00032
    00033 class CMutex;
    00034 class PTEID_Exception;
    00035
    00036 /******************************************************************************//**
    00037   * Base class for the object of PTEID SDK (Can not be instantiated).
    00038   *********************************************************************************/
    00039 class PTEID_Object
    00040 {
    00041 public:
    00042         PTEIDSDK_API virtual ~PTEID_Object()=0;           /**< Destructor */
    00043
    00044
    00045         NOEXPORT_PTEIDSDK void Init(const SDK_Context *context,void *impl);      /**< For internal use : Initialize pimpl */
    00046
    00047         /**
    00048           * Release the objects instantiated within this PTEID_Object.
    00049           * Automatically call in the destructor.
    00050           */
    00051         NOEXPORT_PTEIDSDK void Release();
    00052
    00053 protected:
    00054         PTEID_Object(const SDK_Context *context,void *impl);     /**< For internal use : Constructor */
    00055         void addObject(PTEID_Object *impl);                      /**< For internal use : Add linked object */
    00056         void backupObject(unsigned long idx);           /**< For internal use : Backup linked object */
    00057         PTEID_Object *getObject(unsigned long idx);      /**< For internal use : Return an object by its index */
    00058         PTEID_Object *getObject(void *impl);                     /**< For internal use : Return an object by its impl */
    00059         void delObject(unsigned long idx);                      /**< For internal use : Delete an object by its index */
    00060         void delObject(void *impl);                                     /**< For internal use : Delete an object by its impl */
    00061
    00062         void checkContextStillOk() const;                       /**< For internal use : check if the Context is still correct (the card hasn't changed) */
    00063
    00064         PTEID_Object(const PTEID_Object& obj);                            /**< Copy not allowed - not implemented */
    00065         PTEID_Object& operator= (const PTEID_Object& obj);        /**< Copy not allowed - not implemented */
    00066
    00067         bool m_delimpl;                                                 /**< For internal use : m_impl object must be deleted */
    00068         void *m_impl;                                                   /**< For internal use : pimpl pointer */
    00069         unsigned long m_ulIndexExtAdd;                  /**< For internal use : extended add object */
    00070         std::map<unsigned long,PTEID_Object *> m_objects;        /**< For internal use : Map of object instantiated within this PTEID_Object */
    00071
    00072         SDK_Context *m_context;                                 /**< For internal use : context structure */
    00073
    00074         //CMutex *m_mutex;
    00075 };
    00076
    00077 class PTEID_Card;
    00078
    00079 class CByteArray;
    00080
    00081 /******************************************************************************//**
    00082   * This class is used to receive/pass bytes array from/to different method in the SDK.
    00083   *********************************************************************************/
    00084 class PTEID_ByteArray : public PTEID_Object
    00085 {
    00086 public:
    00087     PTEIDSDK_API PTEID_ByteArray();                                                               /**< Default constructor */
    00088         PTEIDSDK_API PTEID_ByteArray(const PTEID_ByteArray &bytearray); /**< Copy constructor */
    00089
    00090          /**
    00091           * Constructor - initialize a byte array with an array of unsigned char.
    00092           *
    00093           * @param pucData is the byte array
    00094           * @param ulSize is the size of the array
    00095           */
    00096     PTEIDSDK_API PTEID_ByteArray(const unsigned char * pucData, unsigned long ulSize);
    00097
    00098         PTEIDSDK_API virtual ~PTEID_ByteArray();                          /**< Destructor */
    00099
    00100          /**
    00101           * Append data to the byte array.
    00102           *
    00103           * @param pucData is the byte array
    00104           * @param ulSize is the size of the array
    00105           */
    00106     PTEIDSDK_API void Append(const unsigned char * pucData, unsigned long ulSize);
    00107
    00108          /**
    00109           * Append data to the byte array.
    00110           */
    00111     PTEIDSDK_API void Append(const PTEID_ByteArray &data);
    00112
    00113          /**
    00114           * Remove the data from the byte array.
    00115           */
    00116     PTEIDSDK_API void Clear();
    00117
    00118          /**
    00119           * Return true if the content of data is the same as this.
    00120           */
    00121     PTEIDSDK_API bool Equals(const PTEID_ByteArray &data) const;
    00122
    00123          /**
    00124           * Return the number of bytes in the array.
    00125           */
    00126     PTEIDSDK_API unsigned long Size() const;
    00127
    00128         /**
    00129           * Return the array of bytes in the object.
    00130           * If Size() == 0, then NULL is returned.
    00131           */
    00132         PTEIDSDK_API const unsigned char *GetBytes() const;
    00133
    00134         /**
    00135           * Writing the binary content to a file.
    00136           */
    00137         PTEIDSDK_API bool writeToFile(const char * csFilePath);
    00138
    00139         /**
    00140           * Copy content of bytearray.
    00141           */
    00142         PTEIDSDK_API PTEID_ByteArray &operator=(const PTEID_ByteArray &bytearray);
    00143
    00144         NOEXPORT_PTEIDSDK PTEID_ByteArray(const SDK_Context *context,const CByteArray &impl);     /**< For internal use : construct from lower level object*/
    00145         NOEXPORT_PTEIDSDK PTEID_ByteArray &operator=(const CByteArray &bytearray);                        /**< For internal use : copy from lower level object*/
    00146 };
    00147
    00148 /******************************************************************************//**
    00149   * These structure are used for compatibility with old C sdk.
    00150   *********************************************************************************/
    00151 struct PTEID_RawData_Eid
    00152 {
    00153     PTEID_ByteArray idData;
    00154     PTEID_ByteArray idSigData;
    00155     PTEID_ByteArray addrData;
    00156     PTEID_ByteArray addrSigData;
    00157     PTEID_ByteArray sodData;
    00158     PTEID_ByteArray cardData;
    00159     PTEID_ByteArray tokenInfo;
    00160     PTEID_ByteArray certRN;
    00161     PTEID_ByteArray challenge;
    00162     PTEID_ByteArray response;
    00163     PTEID_ByteArray persoData;
    00164     PTEID_ByteArray trace;
    00165 };
    00166
    00167 struct PTEID_RawData_Sis
    00168 {
    00169     PTEID_ByteArray idData;
    00170 };
    00171
    00172 /**
    00173   * This define give an easy access to singleton (no declaration/instantiation is needed).
    00174   *
    00175   * Usage : ReaderSet.SomeMethod().
    00176   */
    00177 #define ReaderSet PTEID_ReaderSet::instance()
    00178
    00179 /**
    00180   * Init the SDK (Optional).
    00181   */
    00182 #define PTEID_InitSDK() PTEID_ReaderSet::initSDK()
    00183
    00184 /**
    00185   * Release the SDK.
    00186   * THIS MUST BE CALLED WHEN THE SDK IS NOT NEEDED ANYMORE AND BEFORE THE APPLICATION IS CALLED.
    00187   * IF NOT RELEASE PROPERLY, AN EXCEPTION PTEID_ExReleaseNeeded IS THROWN.
    00188   */
    00189 #define PTEID_ReleaseSDK() PTEID_ReaderSet::releaseSDK()
    00190
    00191 class PTEID_ReaderContext;
    00192 class APL_ReaderContext;
    00193
    00194 /******************************************************************************//**
    00195   * This is a singleton class that is the starting point to get all other objects.
    00196   * You get an instance from the static instance() method (or using the define ReaderSet).
    00197   * Then you get a READER                                                       (PTEID_ReaderContext)
    00198   *             -> from this reader, you a CARD                         (PTEID_Card or derived class)
    00199   *                     -> from this card, you get DOCUMENT             (PTEID_XMLDoc or derived class)
    00200   *                             -> ...
    00201   *********************************************************************************/
    00202 class PTEID_ReaderSet : public PTEID_Object
    00203 {
    00204 public:
    00205     PTEIDSDK_API static PTEID_ReaderSet &instance();              /**< Return the singleton object (create it at first use) */
    00206
    00207         /**
    00208           * Init the SDK (Optional).
    00209           * @param bManageTestCard If true the applayer must ask if test cards are allowed (used for compatibility with old C API).
    00210           * @param bManageTestCard If false other applications (ex. gui) take that into their scope
    00211           */
    00212         PTEIDSDK_API static void initSDK(bool bManageTestCard=false);
    00213         PTEIDSDK_API static void releaseSDK();                           /**< Release the SDK */
    00214
    00215         PTEIDSDK_API virtual ~PTEID_ReaderSet();                          /**< Destructor */
    00216
    00217         /**
    00218           * Release the readers (Useful if readers had changed).
    00219           *
    00220           * @param bAllReference If true all the invalid reference/pointer are destroyed.
    00221           * @param bAllReference        PUT THIS PARAMETER TO TRUE IS THREAD UNSAFE.
    00222           * @param bAllReference        You have to be sure that you will not use any old reference/pointer after this release
    00223           */
    00224         PTEIDSDK_API void releaseReaders(bool bAllReference=false);
    00225
    00226         /**
    00227           * Return true if readers has been added or removed
    00228           */
    00229         PTEIDSDK_API bool isReadersChanged() const;
    00230
    00231         /**
    00232           * Get the list of the reader.
    00233           * Return an array of const char *
    00234           * The last pointer is NULL
    00235           * Usage : const char * const *ppList=PTEID_ReaderSet::readerList();
    00236           *         for(const char * const *ppName=ppList;*ppName!=NULL;ppName++) {...}
    00237           *
    00238           * @param bForceRefresh force the reconnection to the lower layer to see if reader list have changed
    00239           */
    00240     PTEIDSDK_API const char * const *readerList(bool bForceRefresh=false);
    00241
    00242         /**
    00243           * Return the first readercontext with a card.
    00244           *             If no card is present, return the firs reader.
    00245           *             If no reader exist, throw an exception PTEID_ExNoReader.
    00246           */
    00247         PTEIDSDK_API PTEID_ReaderContext &getReader();
    00248
    00249         /**
    00250           * Get the reader by its name.
    00251           */
    00252         PTEIDSDK_API PTEID_ReaderContext &getReaderByName(const char *readerName);
    00253
    00254         /**
    00255           * Return the number of card readers connected to the computer.
    00256           *
    00257           * @param bForceRefresh force the reconnection to the lower layer to see if reader list have changed
    00258           */
    00259     PTEIDSDK_API unsigned long readerCount(bool bForceRefresh=false);
    00260
    00261         /**
    00262           * Get the name of the reader by its Index.
    00263           * Throw PTEID_ExParamRange exception if the index is out of range.
    00264           */
    00265         PTEIDSDK_API const char *getReaderName(unsigned long ulIndex);
    00266
    00267         /**
    00268           * Get the reader by its Index.
    00269           * Throw PTEID_ExParamRange exception if the index is out of range.
    00270           */
    00271         PTEIDSDK_API PTEID_ReaderContext &getReaderByNum(unsigned long ulIndex);
    00272
    00273         /**
    00274           * Return the reader containing the card with this SN.
    00275           *             If no card with this SN is found, throw an exception PTEID_ExParamRange.
    00276           */
    00277         PTEIDSDK_API PTEID_ReaderContext &getReaderByCardSerialNumber(const char *cardSerialNumber);
    00278
    00279         /**
    00280         * Flush the cached files.
    00281         * Return if any files were flushed (T/F).
    00282         */;
    00283         PTEIDSDK_API bool flushCache();                  /**< Flush the cache */
    00284
    00285         NOEXPORT_PTEIDSDK PTEID_ReaderContext &getReader(APL_ReaderContext *pAplReader); /**< For internal use - Not exported*/
    00286
    00287 private:
    00288         PTEID_ReaderSet();                                                                                       /**< For internal use : Constructor */
    00289
    00290         PTEID_ReaderSet(const PTEID_ReaderSet& reader);                           /**< Copy not allowed - not implemented */
    00291         PTEID_ReaderSet& operator= (const PTEID_ReaderSet& reader);       /**< Copy not allowed - not implemented */
    00292
    00293 };
    00294
    00295 class PTEID_Card;
    00296 class PTEID_EIDCard;
    00297 class PTEID_KidsCard;
    00298 class PTEID_ForeignerCard;
    00299 class PTEID_SISCard;
    00300
    00301 /******************************************************************************//**
    00302   * This class represent a reader.
    00303   * You get reader object from the ReaderSet
    00304   *             either by its index (getReaderByNum) or by its name (getReaderByName).
    00305   * Once you have a reader object, you can check if a card is present (isCardPresent).
    00306   * Then you can ask which type of card is in the reader with getCardType()
    00307   *             and then get a card object using one of this method :
    00308   *                     getCard, getEIDCard, getKidsCard, getForeignerCard or getSISCard.
    00309   *********************************************************************************/
    00310 class PTEID_ReaderContext : public PTEID_Object
    00311 {
    00312 public:
    00313         /**
    00314           * Construct using a fileType and fileName.
    00315           *             No physical reader are connected (m_reader=NULL)
    00316           */
    00317         PTEIDSDK_API PTEID_ReaderContext(PTEID_FileType fileType,const char *fileName);
    00318
    00319         /**
    00320           * Construct using a fileType and its content (for compatibility with SetRawFile).
    00321           *             No physical reader are connected (m_reader=NULL)
    00322           */
    00323         PTEIDSDK_API PTEID_ReaderContext(PTEID_FileType fileType,const PTEID_ByteArray &data);
    00324
    00325         /**
    00326           * Construct using Raw data for Eid.
    00327           *             No physical reader are connected (m_reader=NULL)
    00328           */
    00329         PTEIDSDK_API PTEID_ReaderContext(const PTEID_RawData_Eid &data);
    00330
    00331         /**
    00332           * Construct using Raw data for Sis.
    00333           *             No physical reader are connected (m_reader=NULL)
    00334           */
    00335         PTEIDSDK_API PTEID_ReaderContext(const PTEID_RawData_Sis &data);
    00336
    00337         PTEIDSDK_API virtual ~PTEID_ReaderContext();      /**< Destructor */
    00338
    00339         /**
    00340           * Return the name of the reader.
    00341           */
    00342         PTEIDSDK_API const char *getName();
    00343
    00344         /**
    00345           * Return true if a card is present and false otherwise.
    00346           */
    00347     PTEIDSDK_API bool isCardPresent();
    00348
    00349         /**
    00350           * Release the card.
    00351           *
    00352           * @param bAllReference If true all the invalid reference/pointer are destroyed.
    00353           * @param bAllReference        PUT THIS PARAMETER TO TRUE IS THREAD UNSAFE.
    00354           * @param bAllReference        You have to be sure that you will not use any old reference/pointer after this release
    00355           */
    00356         PTEIDSDK_API void releaseCard(bool bAllReference=false);
    00357
    00358         /**
    00359           * Return true if a card has changed since the last called (with the same ulOldId parameter).
    00360           */
    00361         PTEIDSDK_API bool isCardChanged(unsigned long &ulOldId);
    00362
    00363         /**
    00364          * Return the type of the card in the reader.
    00365          *
    00366          * Throw PTEID_ExNoCardPresent exception if no card is present.
    00367          */
    00368         PTEIDSDK_API PTEID_CardType getCardType();
    00369
    00370         /**
    00371          * Get the card in the reader.
    00372          *              Instantiation is made regarding the type of the card
    00373          *                      (PTEID_EIDCard, PTEID_KidsCard, PTEID_ForeignerCard or PTEID_SISCard).
    00374          *
    00375          * If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown.
    00376          * If the card type is not supported, exception PTEID_ExCardTypeUnknown is thrown.
    00377          */
    00378     PTEIDSDK_API PTEID_Card &getCard();
    00379
    00380         /**
    00381          * Get the EIDcard in the reader.
    00382          *              Instantiation is made regarding the type of the card
    00383          *                      (PTEID_EIDCard, PTEID_KidsCard, PTEID_ForeignerCard).
    00384          *
    00385          * If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown.
    00386          * If the card is not an EIDcard, exception PTEID_ExCardBadType is thrown.
    00387          */
    00388     PTEIDSDK_API PTEID_EIDCard &getEIDCard();
    00389
    00390         /**
    00391          * Get the KidsCard in the reader.
    00392          *
    00393          * If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown.
    00394          * If the card is not a KidsCard, exception PTEID_ExCardBadType is thrown.
    00395          */
    00396         PTEIDSDK_API PTEID_KidsCard &getKidsCard();
    00397
    00398         /**
    00399          * Get the ForeignerCard in the reader.
    00400          *
    00401          * If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown
    00402          * If the card is not a ForeignerCard, exception PTEID_ExCardBadType is thrown.
    00403          */
    00404         PTEIDSDK_API PTEID_ForeignerCard &getForeignerCard();
    00405
    00406         /**
    00407          * Get the SISCard in the reader.
    00408          *
    00409          * If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown.
    00410          * If the card is not a SISCard, exception PTEID_ExCardBadType is thrown.
    00411          */
    00412         PTEIDSDK_API PTEID_SISCard &getSISCard();
    00413
    00414         /**
    00415          * Specify a callback function to be called each time a
    00416          * card is inserted/remove in/from this reader.
    00417          *
    00418          * @return A handle can be used to stop the callbacks when they are no longer needed.
    00419          */
    00420     PTEIDSDK_API unsigned long SetEventCallback(void (* callback)(long lRet, unsigned long ulState, void *pvRef), void *pvRef);
    00421
    00422         /**
    00423           * To tell that the callbacks are not longer needed.
    00424           * @param ulHandle is the handle return by SetEventCallback
    00425           */
    00426         PTEIDSDK_API void StopEventCallback(unsigned long ulHandle);
    00427
    00428         PTEIDSDK_API void BeginTransaction();                                                            /**< Begin a transaction with the reader */
    00429         PTEIDSDK_API void EndTransaction();                                                              /**< End the transaction */
    00430
    00431         PTEIDSDK_API bool isVirtualReader();                                                             /**< Return true if this is a virtual reader (create from a file) */
    00432
    00433 private:
    00434         PTEID_ReaderContext(const PTEID_ReaderContext& reader);                           /**< Copy not allowed - not implemented */
    00435         PTEID_ReaderContext& operator= (const PTEID_ReaderContext& reader);       /**< Copy not allowed - not implemented */
    00436
    00437         PTEID_ReaderContext(const SDK_Context *context,APL_ReaderContext *impl);                                         /**< For internal use : Constructor */
    00438
    00439         unsigned long m_cardid;
    00440         //CMutex *m_mutex;
    00441
    00442 friend PTEID_ReaderContext &PTEID_ReaderSet::getReader(APL_ReaderContext *pAplReader); /**< For internal use : This method must access protected constructor */
    00443 };
    00444
    00445 class PTEID_XMLDoc;
    00446 class APL_Card;
    00447
    00448 /******************************************************************************//**
    00449   * Abstract base class for all the card type supported.
    00450   * The PTEID_ReaderContext::getCard() method will return such an object.
    00451   *********************************************************************************/
    00452 class PTEID_Card : public PTEID_Object
    00453 {
    00454 public:
    00455         PTEIDSDK_API virtual ~PTEID_Card()=0;                             /**< Destructor */
    00456
    00457         /**
    00458          * Return the type of the card
    00459          */
    00460         PTEIDSDK_API virtual PTEID_CardType getType();
    00461
    00462         /**
    00463          * Return a document from the card.
    00464          * Throw PTEID_ExDocTypeUnknown exception if the document doesn't exist for this card.
    00465          */
    00466         PTEIDSDK_API virtual PTEID_XMLDoc& getDocument(PTEID_DocumentType type)=0;
    00467
    00468         /**
    00469          * Return a raw data from the card.
    00470          * Throw PTEID_ExFileTypeUnknown exception if the document doesn't exist for this card.
    00471          */
    00472         PTEIDSDK_API virtual const PTEID_ByteArray& getRawData(PTEID_RawDataType type)=0;
    00473
    00474         /**
    00475          * Send an APDU command to the card and get the result.
    00476          * @param cmd is the apdu command
    00477          * @return a PTEID_ByteArray containing the result
    00478          */
    00479     PTEIDSDK_API virtual PTEID_ByteArray sendAPDU(const PTEID_ByteArray& cmd);
    00480
    00481         /**
    00482          * Read a File from the card.
    00483          * @param fileID is the path of the file
    00484          * @param ulOffset is the offset to begins the reading
    00485          * @param ulMaxLength is the maximum length of bytes to read
    00486          * @return A PTEID_ByteArray with the content of the file
    00487          */
    00488         PTEIDSDK_API virtual PTEID_ByteArray readFile(const char *fileID, unsigned long  ulOffset=0, unsigned long  ulMaxLength=0);
    00489
    00490         /**
    00491          * Write a file to the card.
    00492          * @param fileID is the path of the file
    00493          * @param oData contents the bytes to write
    00494          * @param ulOffset is the offset to begins the writing
    00495          */
    00496         PTEIDSDK_API virtual bool writeFile(const char *fileID, const PTEID_ByteArray& oData,unsigned long ulOffset=0);
    00497
    00498 protected:
    00499         PTEID_Card(const SDK_Context *context,APL_Card *impl);/**< For internal use : Constructor */
    00500
    00501 private:
    00502         PTEID_Card(const PTEID_Card& card);                                       /**< Copy not allowed - not implemented */
    00503         PTEID_Card& operator= (const PTEID_Card& card);           /**< Copy not allowed - not implemented */
    00504
    00505 };
    00506
    00507 class APL_MemoryCard;
    00508
    00509 /******************************************************************************//**
    00510   * Abstract base class for Memory card.
    00511   *********************************************************************************/
    00512 class PTEID_MemoryCard : public PTEID_Card
    00513 {
    00514 public:
    00515         PTEIDSDK_API virtual ~PTEID_MemoryCard()=0;                               /**< Destructor */
    00516
    00517 protected:
    00518         PTEID_MemoryCard(const SDK_Context *context,APL_Card *impl);/**< For internal use : Constructor */
    00519
    00520 private:
    00521         PTEID_MemoryCard(const PTEID_MemoryCard& card);                           /**< Copy not allowed - not implemented */
    00522         PTEID_MemoryCard& operator= (const PTEID_MemoryCard& card);       /**< Copy not allowed - not implemented */
    00523 };
    00524
    00525 class PTEID_Pin;
    00526 class PTEID_Pins;
    00527 class PTEID_Certificates;
    00528 class APL_SmartCard;
    00529
    00530 /******************************************************************************//**
    00531   * Abstract base class for Smart card.
    00532   *********************************************************************************/
    00533 class PTEID_SmartCard : public PTEID_Card
    00534 {
    00535 public:
    00536         PTEIDSDK_API virtual ~PTEID_SmartCard()=0;                                /**< Destructor */
    00537
    00538         /**
    00539          * Select an application from the card
    00540          */
    00541         PTEIDSDK_API void selectApplication(const PTEID_ByteArray &applicationId);
    00542
    00543         /**
    00544          * Send an APDU command to the card and get the result.
    00545          * @param cmd is the apdu command
    00546          * @param pin is the pin to ask for writing
    00547          * @param csPinCode is the code of the pin (it will be asked if needed and not set)
    00548          * @return a PTEID_ByteArray containing the result
    00549          */
    00550     PTEIDSDK_API virtual PTEID_ByteArray sendAPDU(const PTEID_ByteArray& cmd,PTEID_Pin *pin=NULL,const char *csPinCode="");
    00551
    00552         /**
    00553          * Read a File from the card.
    00554          *
    00555          * If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
    00556          *
    00557          * @param fileID is the path of the file
    00558          * @param in return the file
    00559          * @param pin is the pin to ask for reading
    00560          * @param csPinCode is the code of the pin (it will be asked if needed and not set)
    00561          */
    00562         PTEIDSDK_API virtual long readFile(const char *fileID, PTEID_ByteArray &in,PTEID_Pin *pin=NULL,const char *csPinCode="");
    00563
    00564         /**
    00565          * Write a file to the card.
    00566          * Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.
    00567          *
    00568          * If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.
    00569          *
    00570          * @param fileID is the path of the file
    00571          * @param out contents the bytes to write
    00572          * @param pin is the pin to ask for writing
    00573          * @param csPinCode is the code of the pin (it will be asked if needed and not set)
    00574          */
    00575         PTEIDSDK_API virtual bool writeFile(const char *fileID,const PTEID_ByteArray &out,PTEID_Pin *pin=NULL,const char *csPinCode="");
    00576
    00577         /**
    00578          * Return the number of pin on the card.
    00579          */
    00580         PTEIDSDK_API virtual unsigned long pinCount();
    00581
    00582         /**
    00583          * Return an object to access all the pins on the card.
    00584          */
    00585         PTEIDSDK_API virtual PTEID_Pins& getPins();
    00586
    00587         /**
    00588          * Return the number of certificate on the card.
    00589          */
    00590         PTEIDSDK_API virtual unsigned long certificateCount();
    00591
    00592         /**
    00593          * Return an object to access all the certificates on the card.
    00594          */
    00595         PTEIDSDK_API virtual PTEID_Certificates& getCertificates();
    00596
    00597         /**
    00598           * Return the challenge.
    00599           *
    00600           * @param bForceNewInit force a new initialization of the couple challenge/response
    00601           */
    00602         PTEIDSDK_API virtual const PTEID_ByteArray &getChallenge(bool bForceNewInit = false);
    00603
    00604         /**
    00605           * Return the response to the challenge.
    00606           */
    00607         PTEIDSDK_API virtual const PTEID_ByteArray &getChallengeResponse();
    00608
    00609         /**
    00610           * Return true if the response of the card to the given challenge is the same as the response expected.
    00611           * For virtual card (from file), always return false.
    00612           *
    00613           * @param challenge is the challenge to check
    00614           * @param response is the response expected from the card
    00615           */
    00616         PTEIDSDK_API virtual bool verifyChallengeResponse(const PTEID_ByteArray &challenge, const PTEID_ByteArray &response) const;
    00617
    00618 protected:
    00619         PTEID_SmartCard(const SDK_Context *context,APL_Card *impl);      /**< For internal use : Constructor */
    00620
    00621 private:
    00622         PTEID_SmartCard(const PTEID_SmartCard& card);                                             /**< Copy not allowed - not implemented */
    00623         PTEID_SmartCard& operator= (const PTEID_SmartCard& card);                 /**< Copy not allowed - not implemented */
    00624 };
    00625
    00626 class PTEID_SisFullDoc;
    00627 class PTEID_SisId;
    00628 class APL_SISCard;
    00629
    00630 /******************************************************************************//**
    00631   * This class represents a SIS card.
    00632   * To get such an object you have to ask it from the ReaderContext.
    00633   *********************************************************************************/
    00634 class PTEID_SISCard : public PTEID_MemoryCard
    00635 {
    00636 public:
    00637         PTEIDSDK_API virtual ~PTEID_SISCard();                            /**< Destructor */
    00638
    00639         /**
    00640          * Return a document from the card.
    00641          * Throw PTEID_ExDocTypeUnknown exception if the document doesn't exist for this card.
    00642          */
    00643         PTEIDSDK_API virtual PTEID_XMLDoc& getDocument(PTEID_DocumentType type);
    00644
    00645         /**
    00646          * Get the full document.
    00647          */
    00648         PTEIDSDK_API PTEID_SisFullDoc& getFullDoc();
    00649
    00650         /**
    00651          * Get the id document.
    00652          */
    00653         PTEIDSDK_API PTEID_SisId& getID();
    00654
    00655         /**
    00656          * Return a raw data from the card.
    00657          * Throw PTEID_ExFileTypeUnknown exception if the document doesn't exist for this card.
    00658          */
    00659         PTEIDSDK_API virtual const PTEID_ByteArray& getRawData(PTEID_RawDataType type);
    00660
    00661         /**
    00662          * Get the id RawData.
    00663          */
    00664         PTEIDSDK_API const PTEID_ByteArray& getRawData_Id();
    00665
    00666 private:
    00667         PTEID_SISCard(const PTEID_SISCard& card);                         /**< Copy not allowed - not implemented */
    00668         PTEID_SISCard& operator= (const PTEID_SISCard& card);     /**< Copy not allowed - not implemented */
    00669
    00670         PTEID_SISCard(const SDK_Context *context,APL_Card *impl);        /**< For internal use : Constructor */
    00671
    00672 friend PTEID_Card &PTEID_ReaderContext::getCard();                /**< For internal use : This method must access protected constructor */
    00673
    00674 };
    00675
    00676 class PTEID_EIdFullDoc;
    00677 class PTEID_EId;
    00678 class PTEID_Address;
    00679 class PTEID_Sod;
    00680 class PTEID_CardVersionInfo;
    00681 class PTEID_Certificate;
    00682 class APL_EIDCard;
    00683
    00684 /******************************************************************************//**
    00685   * This class represents a Portugal EID card.
    00686   * To get such an object you have to ask it from the ReaderContext.
    00687   *********************************************************************************/
    00688 class PTEID_EIDCard : public PTEID_SmartCard
    00689 {
    00690 public:
    00691         PTEIDSDK_API virtual ~PTEID_EIDCard();                                            /**< Destructor */
    00692
    00693         /**
    00694           * Return true if the user allow the application.
    00695           */
    00696         PTEIDSDK_API static bool isApplicationAllowed();
    00697
    00698         /**
    00699           * Return true this is a test card.
    00700           */
    00701         PTEIDSDK_API virtual bool isTestCard();
    00702
    00703         /**
    00704           * Return true if test card are allowed.
    00705           */
    00706         PTEIDSDK_API virtual bool getAllowTestCard();
    00707
    00708         /**
    00709           * Set the flag to allow the test cards.
    00710           */
    00711         PTEIDSDK_API virtual void setAllowTestCard(bool allow);
    00712
    00713         /**
    00714          * Return a document from the card.
    00715          * Throw PTEID_ExDocTypeUnknown exception if the document doesn't exist for this card.
    00716          */
    00717         PTEIDSDK_API virtual PTEID_XMLDoc& getDocument(PTEID_DocumentType type);
    00718
    00719         PTEIDSDK_API PTEID_EIdFullDoc& getFullDoc();                              /**< Get the full document */
    00720         PTEIDSDK_API PTEID_EId& getID();                                                  /**< Get the id document */
    00721         PTEIDSDK_API PTEID_Address& getAddr();                                    /**< Get the Address document */
    00722         PTEIDSDK_API PTEID_Sod& getSod();                                                 /**< Get the sod document */
    00723         PTEIDSDK_API PTEID_CardVersionInfo& getVersionInfo();             /**< Get the info document  */
    00724
    00725         PTEIDSDK_API PTEID_Certificate &getCert(PTEID_CertifType type);/**< Return certificate by type from the card */
    00726         PTEIDSDK_API PTEID_Certificate &getRoot();                                /**< Return the root certificate from the card */
    00727         PTEIDSDK_API PTEID_Certificate &getCA();                                  /**< Return the ca certificate from the card */
    00728         PTEIDSDK_API PTEID_Certificate &getSignature();                   /**< Return the signature certificate from the card */
    00729         PTEIDSDK_API PTEID_Certificate &getAuthentication();              /**< Return the authentication certificate from the card */
    00730
    00731         /**
    00732          * Return a raw data from the card.
    00733          * Throw PTEID_ExFileTypeUnknown exception if the document doesn't exist for this card.
    00734          */
    00735         PTEIDSDK_API virtual const PTEID_ByteArray& getRawData(PTEID_RawDataType type);
    00736
    00737         PTEIDSDK_API const PTEID_ByteArray& getRawData_Id();                              /**< Get the Id RawData */
    00738         PTEIDSDK_API const PTEID_ByteArray& getRawData_IdSig();                   /**< Get the IdSig RawData */
    00739         PTEIDSDK_API const PTEID_ByteArray& getRawData_Trace();                   /**< Get the Trace RawData */
    00740         PTEIDSDK_API const PTEID_ByteArray& getRawData_Addr();                    /**< Get the Addr RawData */
    00741         PTEIDSDK_API const PTEID_ByteArray& getRawData_AddrSig();                 /**< Get the AddrSig RawData */
    00742         PTEIDSDK_API const PTEID_ByteArray& getRawData_Sod();                             /**< Get the Sod RawData */
    00743         PTEIDSDK_API const PTEID_ByteArray& getRawData_CardInfo();                /**< Get the Card Info RawData */
    00744         PTEIDSDK_API const PTEID_ByteArray& getRawData_TokenInfo();               /**< Get the Token Info RawData */
    00745         PTEIDSDK_API const PTEID_ByteArray& getRawData_Challenge();               /**< Get the challenge RawData */
    00746         PTEIDSDK_API const PTEID_ByteArray& getRawData_Response();                /**< Get the response RawData */
    00747         PTEIDSDK_API const PTEID_ByteArray& getRawData_PersoData();               /**< Get the response RawData */
    00748
    00749 protected:
    00750         PTEID_EIDCard(const SDK_Context *context,APL_Card *impl);                /**< For internal use : Constructor */
    00751
    00752 private:
    00753         PTEID_EIDCard(const PTEID_EIDCard& card);                                         /**< Copy not allowed - not implemented */
    00754         PTEID_EIDCard& operator= (const PTEID_EIDCard& card);                     /**< Copy not allowed - not implemented */
    00755
    00756 friend PTEID_Card &PTEID_ReaderContext::getCard();                                /**< For internal use : This method must access protected constructor */
    00757 };
    00758
    00759 class APL_KidsCard;
    00760
    00761 /******************************************************************************//**
    00762   * This class represents a Kids card which is a particular PTEID_EIDCard.
    00763   * To get such an object you have to ask it from the ReaderContext.
    00764   *********************************************************************************/
    00765 class PTEID_KidsCard : public PTEID_EIDCard
    00766 {
    00767 public:
    00768         PTEIDSDK_API virtual ~PTEID_KidsCard();                           /**< Destructor */
    00769
    00770 private:
    00771         PTEID_KidsCard(const PTEID_KidsCard& card);                               /**< Copy not allowed - not implemented */
    00772         PTEID_KidsCard& operator= (const PTEID_KidsCard& card);   /**< Copy not allowed - not implemented */
    00773
    00774         PTEID_KidsCard(const SDK_Context *context,APL_Card *impl);/**< For internal use : Constructor */
    00775
    00776 friend PTEID_Card &PTEID_ReaderContext::getCard();                        /**< For internal use : This method must access protected constructor */
    00777 };
    00778
    00779 class APL_ForeignerCard;
    00780
    00781 /******************************************************************************//**
    00782   * This class represents a Foreigner card which is a particular PTEID_EIDCard.
    00783   * To get such an object you have to ask it from the ReaderContext.
    00784   *********************************************************************************/
    00785 class PTEID_ForeignerCard : public PTEID_EIDCard
    00786 {
    00787 public:
    00788         PTEIDSDK_API virtual ~PTEID_ForeignerCard();                                      /**< Destructor */
    00789
    00790 private:
    00791         PTEID_ForeignerCard(const PTEID_ForeignerCard& card);                             /**< Copy not allowed - not implemented */
    00792         PTEID_ForeignerCard& operator= (const PTEID_ForeignerCard& card); /**< Copy not allowed - not implemented */
    00793
    00794         PTEID_ForeignerCard(const SDK_Context *context,APL_Card *impl);  /**< For internal use : Constructor */
    00795
    00796 friend PTEID_Card &PTEID_ReaderContext::getCard();        /**< For internal use : This method must access protected constructor */
    00797 };
    00798
    00799 class APL_XMLDoc;
    00800
    00801 /******************************************************************************//**
    00802   * Abstract base class for all the documents.
    00803   *********************************************************************************/
    00804 class PTEID_XMLDoc : public PTEID_Object
    00805 {
    00806 public:
    00807         PTEIDSDK_API virtual ~PTEID_XMLDoc()=0;                           /**< Destructor */
    00808
    00809         PTEIDSDK_API virtual bool isAllowed();                                           /**< The document is allowed */
    00810
    00811         PTEIDSDK_API virtual PTEID_ByteArray getXML();                    /**< Return the document in an XML format */
    00812         PTEIDSDK_API virtual PTEID_ByteArray getCSV();                    /**< Return the document in an CSV format */
    00813         PTEIDSDK_API virtual PTEID_ByteArray getTLV();                    /**< Return the document in an TLV format */
    00814
    00815         /**
    00816           * Write the xml document into the file csFilePath.
    00817           * @return true if succeeded
    00818           */
    00819         PTEIDSDK_API virtual bool writeXmlToFile(const char * csFilePath);
    00820
    00821         /**
    00822           * Write the csv document into the file csFilePath.
    00823           * @return true if succeeded
    00824           */
    00825         PTEIDSDK_API virtual bool writeCsvToFile(const char * csFilePath);
    00826
    00827         /**
    00828           * Write the tlv document into the file csFilePath.
    00829           * @return true if succeeded
    00830           */
    00831         PTEIDSDK_API virtual bool writeTlvToFile(const char * csFilePath);
    00832
    00833 protected:
    00834         PTEID_XMLDoc(const SDK_Context *context,APL_XMLDoc *impl);               /**< For internal use : Constructor */
    00835
    00836 private:
    00837         PTEID_XMLDoc(const PTEID_XMLDoc& doc);                                    /**< Copy not allowed - not implemented */
    00838         PTEID_XMLDoc& operator= (const PTEID_XMLDoc& doc);                /**< Copy not allowed - not implemented */
    00839
    00840 };
    00841
    00842 class APL_Biometric;
    00843
    00844 /******************************************************************************//**
    00845   * Abstract base class for the biometric documents.
    00846   *********************************************************************************/
    00847 class PTEID_Biometric : public PTEID_XMLDoc
    00848 {
    00849 public:
    00850         PTEIDSDK_API virtual ~PTEID_Biometric()=0;                                /**< Destructor */
    00851
    00852 protected:
    00853         PTEID_Biometric(const SDK_Context *context,APL_Biometric *impl); /**< For internal use : Constructor */
    00854
    00855 private:
    00856         PTEID_Biometric(const PTEID_Biometric& doc);                              /**< Copy not allowed - not implemented */
    00857         PTEID_Biometric& operator= (const PTEID_Biometric& doc);  /**< Copy not allowed - not implemented */
    00858 };
    00859
    00860 class APL_Crypto;
    00861
    00862 /******************************************************************************//**
    00863   * Abstract base class for the cryptographic documents.
    00864   *********************************************************************************/
    00865 class PTEID_Crypto : public PTEID_XMLDoc
    00866 {
    00867 public:
    00868         PTEIDSDK_API virtual ~PTEID_Crypto()=0;                   /**< Destructor */
    00869
    00870 protected:
    00871         PTEID_Crypto(const SDK_Context *context,APL_Crypto *impl);       /**< For internal use : Constructor */
    00872
    00873 private:
    00874         PTEID_Crypto(const PTEID_Crypto& doc);                            /**< Copy not allowed - not implemented */
    00875         PTEID_Crypto& operator= (const PTEID_Crypto& doc);        /**< Copy not allowed - not implemented */
    00876 };
    00877
    00878 class APL_DocVersionInfo;
    00879
    00880 /******************************************************************************//**
    00881   * Class for the info document.
    00882   * You can get such an object from PTEID_EIDCard::getVersionInfo() (or getDocument).
    00883   *********************************************************************************/
    00884 class PTEID_CardVersionInfo : public PTEID_XMLDoc
    00885 {
    00886 public:
    00887         PTEIDSDK_API  virtual ~PTEID_CardVersionInfo();           /**< Destructor */
    00888
    00889     PTEIDSDK_API const char *getSerialNumber();                  /**< Return the Serial Number of the card */
    00890         PTEIDSDK_API const char *getComponentCode();                     /**< Return the ComponenCode of the card  */
    00891         PTEIDSDK_API const char *getOsNumber();                          /**< Return the OS Number of the card */
    00892         PTEIDSDK_API const char *getOsVersion();                         /**< Return the OS Version of the card */
    00893         PTEIDSDK_API const char *getSoftmaskNumber();                    /**< Return the Softmask Number of the card */
    00894         PTEIDSDK_API const char *getSoftmaskVersion();           /**< Return the Softmask Version of the card */
    00895         PTEIDSDK_API const char *getAppletVersion();                     /**< Return the Applet Version of the card */
    00896         PTEIDSDK_API const char *getGlobalOsVersion();           /**< Return the Global Os Version of the card */
    00897         PTEIDSDK_API const char *getAppletInterfaceVersion();    /**< Return the Applet Interface Version of the card */
    00898         PTEIDSDK_API const char *getPKCS1Support();                      /**< Return the PKCS#1 Support of the card */
    00899         PTEIDSDK_API const char *getKeyExchangeVersion();                /**< Return the Key Exchange Version of the card */
    00900         PTEIDSDK_API const char *getAppletLifeCycle();           /**< Return the Applet Life Cycle of the card */
    00901         PTEIDSDK_API const char *getGraphicalPersonalisation();                  /**< Return field GraphicalPersonalisation from the Info file */
    00902         PTEIDSDK_API const char *getElectricalPersonalisation();                 /**< Return field ElectricalPersonalisation from the TokenInfo file */
    00903         PTEIDSDK_API const char *getElectricalPersonalisationInterface();        /**< Return field ElectricalPersonalisationInterface from the TokenInfo file */
    00904         PTEIDSDK_API const PTEID_ByteArray &getSignature();               /**< Return the signature of the card info */
    00905
    00906 private:
    00907         PTEID_CardVersionInfo(const PTEID_CardVersionInfo& doc);                          /**< Copy not allowed - not implemented */
    00908         PTEID_CardVersionInfo& operator= (const PTEID_CardVersionInfo& doc);      /**< Copy not allowed - not implemented */
    00909
    00910         PTEID_CardVersionInfo(const SDK_Context *context,APL_DocVersionInfo *impl);      /**< For internal use : Constructor */
    00911
    00912 friend PTEID_CardVersionInfo& PTEID_EIDCard::getVersionInfo();    /**< For internal use : This method must access protected constructor */
    00913 };
    00914
    00915 class APL_SodEid;
    00916
    00917 /******************************************************************************//**
    00918   * Class for the sod document on a EID Card.
    00919   * You can get such an object from PTEID_EIDCard::getSod()      (or getDocument).
    00920   *********************************************************************************/
    00921 class PTEID_Sod : public PTEID_Biometric
    00922 {
    00923 public:
    00924         PTEIDSDK_API virtual ~PTEID_Sod();                                /**< Destructor */
    00925
    00926         PTEIDSDK_API const PTEID_ByteArray& getData();            /**< Return the sod itself */
    00927         PTEIDSDK_API const PTEID_ByteArray& getHash();            /**< Return the hash of the sod */
    00928
    00929 private:
    00930         PTEID_Sod(const PTEID_Sod& doc);                          /**< Copy not allowed - not implemented */
    00931         PTEID_Sod& operator= (const PTEID_Sod& doc);      /**< Copy not allowed - not implemented */
    00932
    00933         PTEID_Sod(const SDK_Context *context,APL_SodEid *impl);/**< For internal use : Constructor */
    00934
    00935 friend PTEID_Sod& PTEID_EIDCard::getSod();                /**< For internal use : This method must access protected constructor */
    00936 };
    00937
    00938 class APL_DocSisId;
    00939
    00940 /******************************************************************************//**
    00941   * Class for the id document on a SIS Card.
    00942   * You can get such an object from PTEID_SISCard::getID()       (or getDocument).
    00943   *********************************************************************************/
    00944 class PTEID_SisId : public PTEID_XMLDoc
    00945 {
    00946 public:
    00947         PTEIDSDK_API virtual ~PTEID_SisId();                                      /**< Destructor */
    00948
    00949     PTEIDSDK_API const char *getName();                                  /**< Return Name field */
    00950         PTEIDSDK_API const char *getSurname();                           /**< Return Surname field */
    00951         PTEIDSDK_API const char *getInitials();                          /**< Return Initials field */
    00952         PTEIDSDK_API const char *getGender();                                    /**< Return Gender field */
    00953         PTEIDSDK_API const char *getDateOfBirth();                       /**< Return Date Of Birth field */
    00954         PTEIDSDK_API const char *getSocialSecurityNumber();      /**< Return Social Security Number field */
    00955         PTEIDSDK_API const char *getLogicalNumber();                     /**< Return Logical Number field */
    00956         PTEIDSDK_API const char *getDateOfIssue();                       /**< Return Date Of Issue field */
    00957         PTEIDSDK_API const char *getValidityBeginDate();         /**< Return Validity Begin Date field */
    00958         PTEIDSDK_API const char *getValidityEndDate();           /**< Return Validity End Date field */
    00959
    00960 private:
    00961         PTEID_SisId(const PTEID_SisId& doc);                                              /**< Copy not allowed - not implemented */
    00962         PTEID_SisId& operator= (const PTEID_SisId& doc);                  /**< Copy not allowed - not implemented */
    00963
    00964         PTEID_SisId(const SDK_Context *context,APL_DocSisId *impl);              /**< For internal use : Constructor */
    00965
    00966 friend PTEID_SisId& PTEID_SISCard::getID();                                       /**< For internal use : This method must access protected constructor */
    00967 };
    00968
    00969 class APL_DocEId;
    00970
    00971 /******************************************************************************//**
    00972   * Class for the id document on a EID Card.
    00973   * You can get such an object from PTEID_EIDCard::getID()       (or getDocument).
    00974   *********************************************************************************/
    00975 class PTEID_EId : public PTEID_XMLDoc
    00976 {
    00977 public:
    00978         PTEIDSDK_API virtual ~PTEID_EId();                                                /**< Destructor */
    00979
    00980         PTEIDSDK_API const char *getDocumentVersion();           /**< Return Document Version field */
    00981         PTEIDSDK_API const char *getDocumentType();                      /**< Return Document Type field */
    00982         PTEIDSDK_API const char *getCountry();                           /**< Return Country field */
    00983         PTEIDSDK_API const char *getFirstName1();                        /**< Return First Name part 1 (2 first given name) */
    00984         PTEIDSDK_API const char *getSurname();                           /**< Return Surname field */
    00985         PTEIDSDK_API const char *getGender();                            /**< Return Gender field */
    00986         PTEIDSDK_API const char *getDateOfBirth();                       /**< Return Date Of Birth field */
    00987         PTEIDSDK_API const char *getLocationOfBirth();           /**< Return Location Of Birth field */
    00988         PTEIDSDK_API const char *getNobility();                          /**< Return Nobility field */
    00989         PTEIDSDK_API const char *getNationality();                       /**< Return Nationality field */
    00990         PTEIDSDK_API const char *getNationalNumber();            /**< Return National Number field */
    00991         PTEIDSDK_API const char *getDuplicata();                         /**< Return Duplicata field */
    00992         PTEIDSDK_API const char *getSpecialOrganization();       /**< Return Special Organization field */
    00993         PTEIDSDK_API const char *getMemberOfFamily();            /**< Return Member Of Family field */
    00994         PTEIDSDK_API const char *getLogicalNumber();                     /**< Return Logical Number field */
    00995         PTEIDSDK_API const char *getChipNumber();                        /**< Return Chip Number field */
    00996         PTEIDSDK_API const char *getValidityBeginDate();         /**< Return Validity Begin Date field */
    00997         PTEIDSDK_API const char *getValidityEndDate();           /**< Return Validity End Date field */
    00998         //PTEIDSDK_API const char *getAddressVersion();          /**< Return Address Version field */
    00999         //PTEIDSDK_API const char *getStreet();                          /**< Return Street field */
    01000         //PTEIDSDK_API const char *getZipCode();                         /**< Return Zip Code field */
    01001         PTEIDSDK_API const char *getSpecialStatus();                     /**< Return Special Status field */
    01002         /*New status for PTeid-ng */
    01003         PTEIDSDK_API     const char *getHeight();                                                /**< Return field Height */
    01004         PTEIDSDK_API     const char *getDocumentNumber();                                /**< Return field DocumentNumber */
    01005         PTEIDSDK_API     const char *getTaxNo();                                                 /**< Return field TaxNo */
    01006         PTEIDSDK_API     const char *getSocialSecurityNo();                              /**< Return field SocialSecurityNo */
    01007         PTEIDSDK_API     const char *getHealthNo();                                              /**< Return field HealthNo */
    01008         PTEIDSDK_API     const char *getIssuingEntity();                                 /**< Return field IssuingEntity */
    01009         PTEIDSDK_API const char *getLocalofRequest();                            /**< Return field LocalofRequest*/
    01010         PTEIDSDK_API     const char *getGivenNameFather();                               /**< Return field GivenNameFather */
    01011         PTEIDSDK_API     const char *getSurnameFather();                                 /**< Return field SurnameFather */
    01012         PTEIDSDK_API     const char *getGivenNameMother();                               /**< Return field GivenNameMother */
    01013         PTEIDSDK_API     const char *getSurnameMother();                                 /**< Return field SurnameMother */
    01014         PTEIDSDK_API     const char *getParents();                                               /**< Return field Parents */
    01015         PTEIDSDK_API     const PTEID_ByteArray& getPhoto();                                                       /**< Return field Photo */
    01016         PTEIDSDK_API     const char *getPersoData();                                             /**< Return field PersoData */
    01017         PTEIDSDK_API     const char *getValidation();                                    /**< Return field Validation */
    01018
    01019
    01020 private:
    01021         PTEID_EId(const PTEID_EId& doc);                                                  /**< Copy not allowed - not implemented */
    01022         PTEID_EId& operator= (const PTEID_EId& doc);                              /**< Copy not allowed - not implemented */
    01023
    01024         PTEID_EId(const SDK_Context *context,APL_DocEId *impl);                  /**< For internal use : Constructor */
    01025
    01026 friend PTEID_EId& PTEID_EIDCard::getID();                                         /**< For internal use : This method must access protected constructor */
    01027 };
    01028
    01029 class APL_AddrEId;
    01030
    01031 /******************************************************************************//**
    01032   * Class for the Address document on a EID Card.
    01033   * You can get such an object from PTEID_EIDCard::getAddr()     (or getDocument).
    01034   *********************************************************************************/
    01035 class PTEID_Address : public PTEID_XMLDoc
    01036 {
    01037 public:
    01038         PTEIDSDK_API virtual ~PTEID_Address();                                            /**< Destructor */
    01039
    01040         //PTEIDSDK_API const char *getAddressVersion();          /**< Return Address Version field */
    01041         //PTEIDSDK_API const char *getStreet();                          /**< Return Street field */
    01042         //PTEIDSDK_API const char *getZipCode();                         /**< Return Zip Code field */
    01043         PTEIDSDK_API const char *getMunicipality();                      /**< Return Municipality field */
    01044         PTEIDSDK_API     const char *getDistrict();                                              /**< Return field District */
    01045         PTEIDSDK_API     const char *getStreetName();                                    /**< Return field StreetName */
    01046         PTEIDSDK_API     const char *getCivilParish();                                   /**< Return field CivilParish */
    01047         PTEIDSDK_API     const char *getStreetType1();                                   /**< Return field StreetType1 */
    01048         PTEIDSDK_API     const char *getStreetType2();                                   /**< Return field StreetType2 */
    01049         PTEIDSDK_API     const char *getBuildingType1();                                 /**< Return field BuildingType1 */
    01050         PTEIDSDK_API     const char *getBuildingType2();                                 /**< Return field BuildingType2 */
    01051         PTEIDSDK_API     const char *getDoorNo();                                                /**< Return field DoorNo */
    01052         PTEIDSDK_API     const char *getFloor();                                                 /**< Return field Floor */
    01053         PTEIDSDK_API     const char *getSide();                                                  /**< Return field Side */
    01054         PTEIDSDK_API     const char *getLocality();                                              /**< Return field Locality */
    01055         PTEIDSDK_API     const char *getPlace();                                         /**< Return field Locality */
    01056         PTEIDSDK_API     const char *getZip4();                                                  /**< Return field Zip4 */
    01057         PTEIDSDK_API     const char *getZip3();                                                  /**< Return field Zip3 */
    01058         PTEIDSDK_API     const char *getPostalLocality();                                /**< Return field PostalLocality */
    01059
    01060 private:
    01061         PTEID_Address(const PTEID_Address& doc);                                                  /**< Copy not allowed - not implemented */
    01062         PTEID_Address& operator= (const PTEID_Address& doc);                              /**< Copy not allowed - not implemented */
    01063
    01064         PTEID_Address(const SDK_Context *context,APL_AddrEId *impl);                     /**< For internal use : Constructor */
    01065
    01066 friend PTEID_Address& PTEID_EIDCard::getAddr();                                           /**< For internal use : This method must access protected constructor */
    01067 };
    01068
    01069 class APL_SisFullDoc;
    01070
    01071 /******************************************************************************//**
    01072   * Class for the full document Sis.
    01073   *********************************************************************************/
    01074 class PTEID_SisFullDoc : public PTEID_XMLDoc
    01075 {
    01076 public:
    01077         PTEIDSDK_API virtual ~PTEID_SisFullDoc();                                 /**< Destructor */
    01078
    01079 protected:
    01080         PTEID_SisFullDoc(const SDK_Context *context,APL_SisFullDoc *impl);       /**< For internal use : Constructor */
    01081
    01082 private:
    01083         PTEID_SisFullDoc(const PTEID_SisFullDoc& doc);                            /**< Copy not allowed - not implemented */
    01084         PTEID_SisFullDoc& operator= (const PTEID_SisFullDoc& doc);        /**< Copy not allowed - not implemented */
    01085
    01086 friend PTEID_SisFullDoc& PTEID_SISCard::getFullDoc();                             /**< For internal use : This method must access protected constructor */
    01087 };
    01088
    01089 class APL_EIdFullDoc;
    01090
    01091 /******************************************************************************//**
    01092   * Class for the full document Eid.
    01093   *********************************************************************************/
    01094 class PTEID_EIdFullDoc : public PTEID_XMLDoc
    01095 {
    01096 public:
    01097         PTEIDSDK_API virtual ~PTEID_EIdFullDoc();                                 /**< Destructor */
    01098
    01099 protected:
    01100         PTEID_EIdFullDoc(const SDK_Context *context,APL_EIdFullDoc *impl);       /**< For internal use : Constructor */
    01101
    01102 private:
    01103         PTEID_EIdFullDoc(const PTEID_EIdFullDoc& doc);                            /**< Copy not allowed - not implemented */
    01104         PTEID_EIdFullDoc& operator= (const PTEID_EIdFullDoc& doc);        /**< Copy not allowed - not implemented */
    01105
    01106 friend PTEID_EIdFullDoc& PTEID_EIDCard::getFullDoc();                             /**< For internal use : This method must access protected constructor */
    01107 };
    01108 class PTEID_Pin;
    01109 class APL_Pins;
    01110
    01111 /******************************************************************************//**
    01112   * Container class for all pins on the card.
    01113   *********************************************************************************/
    01114 class PTEID_Pins : public PTEID_Crypto
    01115 {
    01116 public:
    01117         PTEIDSDK_API virtual ~PTEID_Pins();                               /**< Destructor */
    01118
    01119         PTEIDSDK_API unsigned long count();                                              /**< The number of pins on the card */
    01120
    01121         /**
    01122           * Get the pin by its Index.
    01123           * Throw PTEID_ExParamRange exception if the index is out of range.
    01124           */
    01125         PTEIDSDK_API PTEID_Pin &getPinByNumber(unsigned long ulIndex);
    01126
    01127 private:
    01128         PTEID_Pins(const PTEID_Pins& pins);                                       /**< Copy not allowed - not implemented */
    01129         PTEID_Pins& operator= (const PTEID_Pins& pins);           /**< Copy not allowed - not implemented */
    01130
    01131         PTEID_Pins(const SDK_Context *context,APL_Pins *impl);           /**< For internal use : Constructor */
    01132
    01133 friend PTEID_Pins& PTEID_SmartCard::getPins();                    /**< For internal use : This method must access protected constructor */
    01134 };
    01135
    01136 class APL_Pin;
    01137
    01138 /******************************************************************************//**
    01139   * Class that represent one Pin.
    01140   *********************************************************************************/
    01141 class PTEID_Pin : public PTEID_Crypto
    01142 {
    01143 public:
    01144         PTEIDSDK_API virtual ~PTEID_Pin();                                /**< Destructor */
    01145
    01146         PTEIDSDK_API unsigned long getIndex();           /**< Get the index of the pin */
    01147         PTEIDSDK_API unsigned long getType();                    /**< Get the type of the pin */
    01148         PTEIDSDK_API unsigned long getId();                      /**< Get the id of the pin */
    01149         PTEIDSDK_API PTEID_PinUsage getUsageCode();       /**< Get the usage code of the pin */
    01150         PTEIDSDK_API unsigned long getFlags();           /**< Get the flags of the pin */
    01151         PTEIDSDK_API const char *getLabel();                     /**< Get the label of the pin */
    01152
    01153         PTEIDSDK_API const PTEID_ByteArray &getSignature();       /**< Return the signature of the pin */
    01154
    01155         /**
    01156           * Return the remaining tries for giving the good pin.
    01157           *
    01158           * This opperation is not supported by all card.
    01159           *
    01160           * @return -1 if not supported
    01161           * @return the number of remaining tries in the other case
    01162           */
    01163         PTEIDSDK_API long getTriesLeft();
    01164
    01165         /**
    01166           * Ask the card to verify the pin.
    01167           * A popup will ask for the code.
    01168           * @return true if success and false if failed
    01169           */
    01170         PTEIDSDK_API bool verifyPin();
    01171
    01172         /**
    01173           * Ask the card to verify the pin.
    01174           *
    01175           * @param csPin is the pin code to verify (if csPin is empty, a popup will ask for the code)
    01176           * @param ulRemaining return the remaining tries (only if verifying failed)
    01177           *
    01178           * @return true if success and false if failed
    01179           */
    01180         PTEIDSDK_API bool verifyPin(const char *csPin,unsigned long &ulRemaining);
    01181
    01182         /**
    01183           * Ask the card to change the pin.
    01184           * A popup will ask for the codes
    01185           * @return true if success and false if failed
    01186           */
    01187         PTEIDSDK_API bool changePin();
    01188
    01189         /**
    01190           * Ask the card to change the pin.
    01191           *
    01192           * if csPin1 or csPin2 are empty, a popup will ask for the codes.
    01193           *
    01194           * @param csPin1 is the old pin code
    01195           * @param csPin2 is the new pin code
    01196           * @param ulRemaining return the remaining tries (only when operation failed)
    01197           *
    01198           * @return true if success and false if failed
    01199           */
    01200         PTEIDSDK_API bool changePin(const char *csPin1,const char *csPin2,unsigned long &ulRemaining, const char *PinName);
    01201
    01202 private:
    01203         PTEID_Pin(const PTEID_Pin& pin);                                                                  /**< Copy not allowed - not implemented */
    01204         PTEID_Pin& operator= (const PTEID_Pin& pin);                                              /**< Copy not allowed - not implemented */
    01205
    01206         PTEID_Pin(const SDK_Context *context,APL_Pin *impl);                                             /**< For internal use : Constructor */
    01207
    01208 friend PTEID_Pin &PTEID_Pins::getPinByNumber(unsigned long ulIndex);      /**< For internal use : This method must access protected constructor */
    01209 };
    01210
    01211 class APL_Crl;
    01212
    01213 /******************************************************************************//**
    01214   * Class that represents one CRL.
    01215   *********************************************************************************/
    01216 class PTEID_Crl : public PTEID_Object
    01217 {
    01218 public:
    01219         /**
    01220           * Create a Crl from its uri (without any certificate link).
    01221           * As there is no issuer, this CRL can't be verify and some method are not allowed
    01222           * (ex. getIssuer).
    01223           * These methods throw PTEID_ExBadUsage exception.
    01224           */
    01225         PTEIDSDK_API PTEID_Crl(const char *uri);
    01226
    01227         PTEIDSDK_API virtual ~PTEID_Crl(void);                            /**< Destructor */
    01228
    01229         PTEIDSDK_API const char *getUri();                               /**< Return the uri of the CRL */
    01230
    01231         PTEIDSDK_API const char *getIssuerName();                        /**< Return the name of the issuer of the certificate */
    01232
    01233         /**
    01234           * Return the issuer certificate.
    01235           *
    01236           * if there is no issuer (root), PTEID_ExCertNoIssuer exception is thrown.
    01237           */
    01238         PTEIDSDK_API PTEID_Certificate &getIssuer();
    01239
    01240         /**
    01241           * Return the CRL as a byte array.
    01242           * If it comes from a Certif we verify the signature.
    01243           * If it's created from the URL only we DON'T verify the signature.
    01244           * @param crl will content the crl
    01245           * @param bForceDownload : if true the CRL in the cache is not valid anymore and we force a new download
    01246           */
    01247         PTEIDSDK_API PTEID_CrlStatus getData(PTEID_ByteArray &crl,bool bForceDownload=false);
    01248
    01249         NOEXPORT_PTEIDSDK PTEID_Crl(const SDK_Context *context,APL_Crl *impl);    /**< For internal use : Constructor */
    01250
    01251 private:
    01252         PTEID_Crl(const PTEID_Crl& crl);                          /**< Copy not allowed - not implemented */
    01253         PTEID_Crl &operator= (const PTEID_Crl& crl);      /**< Copy not allowed - not implemented */
    01254 };
    01255
    01256 class APL_OcspResponse;
    01257
    01258 /******************************************************************************//**
    01259   * Class that represents one OCSP Response.
    01260   *********************************************************************************/
    01261 class PTEID_OcspResponse : public PTEID_Object
    01262 {
    01263 public:
    01264         /**
    01265           * Create an OcspResponse object from the URI only and CertID.
    01266           * This OCSP Response is not link to any certificate so some methods could not be used.
    01267           * These methods throw PTEID_ExBadUsage exception.
    01268           */
    01269         PTEIDSDK_API PTEID_OcspResponse(const char *uri,PTEID_HashAlgo hashAlgorithm,const PTEID_ByteArray &issuerNameHash,const PTEID_ByteArray &issuerKeyHash,const PTEID_ByteArray &serialNumber);
    01270
    01271         PTEIDSDK_API virtual ~PTEID_OcspResponse(void);           /**< Destructor */
    01272
    01273         PTEIDSDK_API const char *getUri();                                       /**< Return the uri of the responder */
    01274
    01275         /**
    01276           * Return the response.
    01277           */
    01278         PTEIDSDK_API PTEID_CertifStatus getResponse(PTEID_ByteArray &response);
    01279
    01280         NOEXPORT_PTEIDSDK PTEID_OcspResponse(const SDK_Context *context,APL_OcspResponse *impl);  /**< For internal use : Constructor */
    01281
    01282 private:
    01283         PTEID_OcspResponse(const PTEID_OcspResponse& ocsp);                               /**< Copy not allowed - not implemented */
    01284         PTEID_OcspResponse &operator= (const PTEID_OcspResponse& ocsp);   /**< Copy not allowed - not implemented */
    01285 };
    01286
    01287 class APL_Certifs;
    01288
    01289 /******************************************************************************//**
    01290   * Container class for all certificates on the card.
    01291   *********************************************************************************/
    01292 class PTEID_Certificates : public PTEID_Crypto
    01293 {
    01294 public:
    01295         /**
    01296           * Create an PTEID_Certificates store without any link to a card.
    01297           * This store is not link to any Card, so some methods could not be used.
    01298           * These methods throw PTEID_ExBadUsage exception.
    01299           */
    01300         PTEIDSDK_API PTEID_Certificates();
    01301
    01302         PTEIDSDK_API virtual ~PTEID_Certificates();                                       /**< Destructor */
    01303
    01304         PTEIDSDK_API unsigned long countFromCard();                                      /**< The number of certificates on the card */
    01305         PTEIDSDK_API unsigned long countAll();                                           /**< The number of certificates (on the card or not) */
    01306
    01307         /**
    01308           * Get the ulIndex certificate from the card.
    01309           * Throw PTEID_ExParamRange exception if the index is out of range.
    01310           */
    01311         PTEIDSDK_API PTEID_Certificate &getCertFromCard(unsigned long ulIndexCard);
    01312
    01313         /**
    01314           * Return the certificate with the number ulIndexAll.
    01315           *
    01316           * ATTENTION ulIndexAll and ulIndexCard are two different index.
    01317           * Index will change if new certificates are added with addCert().
    01318           */
    01319         PTEIDSDK_API PTEID_Certificate &getCert(unsigned long ulIndexAll);
    01320
    01321         /**
    01322           * Return the certificate by type.
    01323           */
    01324         PTEIDSDK_API PTEID_Certificate &getCert(PTEID_CertifType type);
    01325
    01326         PTEIDSDK_API PTEID_Certificate &getRoot();                                        /**< Return the root certificate from the card */
    01327         PTEIDSDK_API PTEID_Certificate &getCA();                                          /**< Return the ca certificate from the card */
    01328         PTEIDSDK_API PTEID_Certificate &getSignature();                           /**< Return the signature certificate from the card */
    01329         PTEIDSDK_API PTEID_Certificate &getAuthentication();                      /**< Return the authentication certificate from the card */
    01330
    01331         /**
    01332           * Add a new certificate to the store.
    01333           */
    01334         PTEIDSDK_API PTEID_Certificate &addCertificate(PTEID_ByteArray &cert);
    01335
    01336
    01337 private:
    01338         PTEID_Certificates(const PTEID_Certificates& certifs);                    /**< Copy not allowed - not implemented */
    01339         PTEID_Certificates& operator= (const PTEID_Certificates& certifs);/**< Copy not allowed - not implemented */
    01340
    01341         PTEID_Certificates(const SDK_Context *context,APL_Certifs *impl);/**< For internal use : Constructor */
    01342
    01343 friend PTEID_Certificates& PTEID_SmartCard::getCertificates();            /**< For internal use : This method must access protected constructor */
    01344 };
    01345
    01346 class APL_Certif;
    01347
    01348 /******************************************************************************//**
    01349   * Class that represent one certificate.
    01350   *********************************************************************************/
    01351 class PTEID_Certificate : public PTEID_Crypto
    01352 {
    01353 public:
    01354         PTEIDSDK_API virtual ~PTEID_Certificate();                        /**< Destructor */
    01355
    01356         PTEIDSDK_API const char *getLabel();                             /**< Return the label of the certificate */
    01357         PTEIDSDK_API unsigned long getID();                              /**< Return the id of the certificate */
    01358
    01359         /**
    01360           * Return the status of the certificate using default validation level (from config).
    01361           */
    01362         PTEIDSDK_API PTEID_CertifStatus getStatus();
    01363
    01364         /**
    01365           * Return the status of the certificate.
    01366           */
    01367         PTEIDSDK_API PTEID_CertifStatus getStatus(PTEID_ValidationLevel crl, PTEID_ValidationLevel ocsp);
    01368
    01369         PTEIDSDK_API PTEID_CertifType getType();                  /**< Return the type of the certificate */
    01370
    01371         PTEIDSDK_API const PTEID_ByteArray &getCertData();/**< Return the content of the certificate */
    01372         PTEIDSDK_API void getFormattedData(PTEID_ByteArray &data);        /**< Return the content of the certificate without ending zero */
    01373         PTEIDSDK_API const char *getSerialNumber();              /**< Return the serial number of the certificate */
    01374         PTEIDSDK_API const char *getOwnerName();                 /**< Return the name of the owner of the certificate */
    01375         PTEIDSDK_API const char *getIssuerName();                        /**< Return the name of the issuer of the certificate */
    01376         PTEIDSDK_API const char *getValidityBegin();             /**< Return the validity begin date of the certificate */
    01377         PTEIDSDK_API const char *getValidityEnd();               /**< Return the validity end date of the certificate */
    01378         PTEIDSDK_API unsigned long getKeyLength();               /**< Return the length of public/private key on the certificate */
    01379
    01380         /**
    01381           * Return true if this is a root certificate.
    01382           */
    01383         PTEIDSDK_API bool isRoot();
    01384
    01385         /**
    01386           * Return the test status.
    01387           *
    01388           * @return true if test certificate
    01389           * @return false if good one
    01390           */
    01391         PTEIDSDK_API bool isTest();
    01392
    01393         /**
    01394           * Return true if the certificate chain end by the one of pteid root.
    01395           */
    01396         PTEIDSDK_API bool isFromPteidValidChain();
    01397
    01398         /**
    01399           * This certificate comes from the card.
    01400           */
    01401         PTEIDSDK_API bool isFromCard();
    01402
    01403         /**
    01404           * Return the issuer certificate.
    01405           *
    01406           * if there is no issuer (root), PTEID_ExCertNoIssuer exception is thrown
    01407           */
    01408         PTEIDSDK_API PTEID_Certificate &getIssuer();
    01409
    01410         /**
    01411           * Return the number of children for this certificate.
    01412           */
    01413         PTEIDSDK_API unsigned long countChildren();
    01414
    01415         /**
    01416           * Return the children certificate (certificate that has been issued by this one).
    01417           *
    01418           * @param ulIndex is the children index (the index for the first child is 0)
    01419           * Throw PTEID_ExParamRange exception if the index is out of range
    01420           */
    01421         PTEIDSDK_API PTEID_Certificate &getChildren(unsigned long ulIndex);
    01422
    01423         /**
    01424           * Return the crl of the certificate.
    01425           */
    01426         PTEIDSDK_API PTEID_Crl &getCRL();
    01427
    01428         /**
    01429           * Return the ocsp response object of the certificate.
    01430           */
    01431         PTEIDSDK_API PTEID_OcspResponse &getOcspResponse();
    01432
    01433
    01434         PTEIDSDK_API PTEID_CertifStatus verifyCRL(bool forceDownload=false);              /**< Verify the certificate trough CRL validation */
    01435         PTEIDSDK_API PTEID_CertifStatus verifyOCSP();                                                             /**< Verify the certificate trough OCSP validation */
    01436
    01437 private:
    01438         PTEID_Certificate(const PTEID_Certificate& certif);                               /**< Copy not allowed - not implemented */
    01439         PTEID_Certificate& operator= (const PTEID_Certificate& certif);   /**< Copy not allowed - not implemented */
    01440
    01441         PTEID_Certificate(const SDK_Context *context,APL_Certif *impl);  /**< For internal use : Constructor */
    01442
    01443 friend PTEID_Certificate &PTEID_Certificates::getCert(unsigned long ulIndex);     /**< For internal use : This method must access protected constructor */
    01444 friend PTEID_Certificate &PTEID_Certificates::getCertFromCard(unsigned long ulIndex);     /**< For internal use : This method must access protected constructor */
    01445 friend PTEID_Certificate &PTEID_Certificates::getCert(PTEID_CertifType type);                      /**< For internal use : This method must access protected constructor */
    01446 friend PTEID_Certificate &PTEID_Crl::getIssuer();                                                                         /**< For internal use : This method must access protected constructor */
    01447 friend PTEID_Certificate &PTEID_Certificates::addCertificate(PTEID_ByteArray &cert);       /**< For internal use : This method must access protected constructor */
    01448 };
    01449
    01450 class APL_Config;
    01451
    01452 /******************************************************************************//**
    01453   * Class to access the config parameters.
    01454   *********************************************************************************/
    01455 class PTEID_Config : public PTEID_Object
    01456 {
    01457 public:
    01458         /**
    01459           * Create object to access parameter Param.
    01460           */
    01461     PTEIDSDK_API PTEID_Config(PTEID_Param Param);
    01462
    01463         /**
    01464           * Create object to access a string parameter.
    01465           */
    01466     PTEIDSDK_API PTEID_Config(const char *csName, const char *czSection, const char *csDefaultValue);
    01467
    01468         /**
    01469           * Create object to access a numerical parameter.
    01470           */
    01471     PTEIDSDK_API PTEID_Config(const char *csName, const char *czSection, long lDefaultValue);
    01472
    01473         PTEIDSDK_API virtual ~PTEID_Config();                     /**< Destructor */
    01474
    01475     PTEIDSDK_API const char *getString();                /**< Return the string value (Throw exception for numerical parameter) */
    01476     PTEIDSDK_API long getLong();                                 /**< Return the numerical value (Throw exception for string parameter) */
    01477
    01478     PTEIDSDK_API void setString(const char *csValue);    /**< Set the string value (Throw exception for numerical parameter) */
    01479         PTEIDSDK_API void setLong(long lValue);                          /**< Set the numerical value (Throw exception for string parameter) */
    01480
    01481 private:
    01482         PTEID_Config(const PTEID_Config& config);                         /**< Copy not allowed - not implemented */
    01483         PTEID_Config& operator= (const PTEID_Config& config);     /**< Copy not allowed - not implemented */
    01484
    01485         PTEID_Config(APL_Config *impl);  /**< For internal use : Constructor */
    01486 };
    01487
    01488 /******************************************************************************//**
    01489   * Function for Logging.
    01490   *********************************************************************************/
    01491 PTEIDSDK_API void PTEID_LOG(PTEID_LogLevel level, const char *module_name, const char *format, ...);
    01492
    01493 }
    01494
    01495 #endif //__PTEIDLIB_H__