kssld.h
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #ifndef __KSSLD_H__
00023 #define __KSSLD_H__
00024 
00025 #include <kded/kdedmodule.h>
00026 #include <ksslcertificate.h>
00027 #include <ksslcertificatecache.h>
00028 #include <qstring.h>
00029 #include <qstringlist.h>
00030 #include <qvaluelist.h>
00031 #include <qmap.h>
00032 #include <qptrvector.h>
00033 
00034 
00035 class KSimpleConfig;
00036 class KSSLCNode;
00037 class KOpenSSLProxy;
00038 
00039 class KSSLD : public KDEDModule
00040 {
00041   Q_OBJECT
00042   K_DCOP
00043 
00044 public:
00045   
00046   KSSLD(const QCString &name);
00047   
00048   virtual ~KSSLD();
00049 
00050 k_dcop:
00051   
00052   
00053   
00054   void cacheAddCertificate(KSSLCertificate cert, 
00055                    KSSLCertificateCache::KSSLCertificatePolicy policy,
00056                    bool permanent = true);
00057   KSSLCertificateCache::KSSLCertificatePolicy cacheGetPolicyByCN(QString cn);
00058 
00059   KSSLCertificateCache::KSSLCertificatePolicy cacheGetPolicyByCertificate(KSSLCertificate cert);
00060 
00061   bool cacheSeenCN(QString cn);
00062   bool cacheSeenCertificate(KSSLCertificate cert);
00063 
00064   bool cacheRemoveByCN(QString cn);
00065   bool cacheRemoveBySubject(QString subject);
00066   bool cacheRemoveByCertificate(KSSLCertificate cert);
00067            
00068   bool cacheIsPermanent(KSSLCertificate cert);
00069 
00070   void cacheReload();
00071 
00072   bool cacheModifyByCN(QString cn,
00073                        KSSLCertificateCache::KSSLCertificatePolicy policy,
00074                        bool permanent,
00075                        QDateTime expires);
00076 
00077   bool cacheModifyByCertificate(KSSLCertificate cert,
00078                            KSSLCertificateCache::KSSLCertificatePolicy policy,
00079                                 bool permanent,
00080                                 QDateTime expires);
00081 
00082   QStringList cacheGetHostList(KSSLCertificate cert);
00083 
00084   bool cacheAddHost(KSSLCertificate cert, QString host);
00085 
00086   bool cacheRemoveHost(KSSLCertificate cert, QString host);
00087 
00088   
00089   void caVerifyUpdate();
00090   bool caRegenerate();
00091 
00092   QStringList caList();
00093 
00094   bool caUseForSSL(QString subject);
00095 
00096   bool caUseForEmail(QString subject);
00097   
00098   bool caUseForCode(QString subject);
00099 
00100   bool caAdd(QString certificate, bool ssl, bool email, bool code);
00101 
00102   bool caRemove(QString subject);
00103 
00104   QString caGetCert(QString subject);
00105 
00106   bool caSetUse(QString subject, bool ssl, bool email, bool code);
00107 
00108   QStringList getKDEKeyByEmail(const QString &email);
00109 
00110   KSSLCertificate getCertByMD5Digest(const QString &key);
00111 
00112   
00113   
00114   
00115 
00116 private:
00117 
00118   void cacheClearList();
00119   void cacheSaveToDisk();
00120   void cacheLoadDefaultPolicies();
00121 
00122   
00123   KSimpleConfig *cfg;
00124   QPtrList<KSSLCNode> certList;
00125 
00126   
00127   KOpenSSLProxy *kossl;
00128 
00129   
00130   void searchAddCert(KSSLCertificate *cert);
00131   void searchRemoveCert(KSSLCertificate *cert);
00132 
00133   QMap<QString, QPtrVector<KSSLCertificate> > skEmail;
00134   QMap<QString, KSSLCertificate *> skMD5Digest;
00135 };
00136 
00137 
00138 #endif
 
This file is part of the documentation for kio Library Version 3.2.0.