• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
  • tdehw
tdecryptographiccarddevice.h
1/* This file is part of the TDE libraries
2 Copyright (C) 2015 Timothy Pearson <kb9vqf@pearsoncomputing.net>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#ifndef _TDECRYPTOGRAPHICCARDDEVICE_H
20#define _TDECRYPTOGRAPHICCARDDEVICE_H
21
22#include "ksslconfig.h"
23#include "tdegenericdevice.h"
24
25#ifndef _TDECRYPTOGRAPHICCARDDEVICE_INTERNAL
26 #ifdef KSSL_HAVE_SSL
27 typedef struct x509_st X509;
28 #else
29 struct X509;
30 #endif
31#endif
32
33class TQEventLoopThread;
34class CryptoCardDeviceWatcher;
35
36typedef TQValueList<X509*> X509CertificatePtrList;
37typedef TQValueListIterator<X509*> X509CertificatePtrListIterator;
38
39class TDECORE_EXPORT TDECryptographicCardDevice : public TDEGenericDevice
40{
41 TQ_OBJECT
42
43 public:
48 TDECryptographicCardDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn=TQString::null);
49
53 ~TDECryptographicCardDevice();
54
59 void enableCardMonitoring(bool enable);
60
73 void enablePINEntryCallbacks(bool enable);
74
81 int cardPresent();
82
88 TQString cardATR();
89
98 X509CertificatePtrList cardX509Certificates();
99
107 void setProvidedPin(TQString pin);
108
117 TQString autoPIN();
118
130 int decryptDataEncryptedWithCertPublicKey(TQByteArray &ciphertext, TQByteArray &plaintext, TQString *errstr=NULL);
131
144 int decryptDataEncryptedWithCertPublicKey(TQValueList<TQByteArray> &cipherTextList, TQValueList<TQByteArray> &plainTextList, TQValueList<int> &retcodes, TQString *errstr);
145
154 static int createNewSecretRSAKeyFromCertificate(TQByteArray &plaintext, TQByteArray &ciphertext, X509* certificate);
155
159 static TQString pkcsProviderLibrary();
160
161 public slots:
162 void cardStatusChanged(TQString status, TQString atr);
163 void workerRequestedPin(TQString prompt);
164
165 signals:
166 void cardInserted(TDECryptographicCardDevice*);
167 void cardRemoved(TDECryptographicCardDevice*);
168 void certificateListAvailable(TDECryptographicCardDevice*);
169 void pinRequested(TQString prompt, TDECryptographicCardDevice* cdevice);
170
171 private:
172 TQEventLoopThread *m_watcherThread;
173 CryptoCardDeviceWatcher *m_watcherObject;
174
175 bool m_cardPresent;
176 TQString m_cardATR;
177 X509CertificatePtrList m_cardCertificates;
178
179 friend class TDEHardwareDevices;
180 friend class CryptoCardDeviceWatcher;
181};
182
183#endif // _TDECRYPTOGRAPHICCARDDEVICE_H

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.