tdecore
tdecryptographiccarddevice_private.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _TDECRYPTOGRAPHICCARDDEVICE_PRIVATE_H
00021 #define _TDECRYPTOGRAPHICCARDDEVICE_PRIVATE_H
00022
00023 #include "tdegenericdevice.h"
00024
00025 #ifdef WITH_PCSC
00026 #include <pcsclite.h>
00027 #include <wintypes.h>
00028 #include <winscard.h>
00029 #include <reader.h>
00030 #endif
00031
00032 #ifdef WITH_PKCS
00033 #include <pkcs11-helper-1.0/pkcs11h-certificate.h>
00034 #include <pkcs11-helper-1.0/pkcs11h-openssl.h>
00035 #include <openssl/x509v3.h>
00036 #define PKCS11H_PROMPT_MASK_ALLOW_NONE (PKCS11H_PROMPT_MASK_ALLOW_ALL & ~PKCS11H_PROMPT_MASK_ALLOW_ALL)
00037 #endif
00038
00039 class TDECryptographicCardDevice;
00040
00041 class CryptoCardDeviceWatcher : public TQObject
00042 {
00043 TQ_OBJECT
00044
00045 public:
00046 CryptoCardDeviceWatcher();
00047 ~CryptoCardDeviceWatcher();
00048
00049 public slots:
00050 void run();
00051 void requestTermination();
00052 TQString getCardATR(TQString readerName);
00053 int retrieveCardCertificates(TQString readerName);
00054
00055 signals:
00056 void statusChanged(TQString, TQString);
00057 void pinRequested(TQString);
00058
00059 public:
00060 int initializePkcs();
00061 TQString doPinRequest(TQString prompt);
00062 void setProvidedPin(TQString pin);
00063 void retrySamePin(bool enable);
00064 void enablePINEntryCallbacks(bool enable);
00065
00066 public:
00067 TDECryptographicCardDevice *cardDevice;
00068
00069 private:
00070 void deleteAllCertificatesFromCache();
00071
00072 private:
00073 bool m_terminationRequested;
00074 bool m_pinCallbacksEnabled;
00075 TQString m_cardPIN;
00076 bool m_cardPINPromptDone;
00077 bool m_cardReusePIN;
00078 #ifdef WITH_PCSC
00079 SCARDCONTEXT m_cardContext;
00080 SCARD_READERSTATE *m_readerStates;
00081 #endif
00082 };
00083
00084 #endif // _TDECRYPTOGRAPHICCARDDEVICE_PRIVATE_H