tdecryptographiccarddevice_private.h
00001 00002 /* This file is part of the TDE libraries 00003 Copyright (C) 2015 Timothy Pearson <kb9vqf@pearsoncomputing.net> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library 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 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 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
Trinity API Reference