kio Library API Documentation

kssld.h

00001 /*
00002    This file is part of the KDE libraries
00003 
00004    Copyright (c) 2001 George Staikos <staikos@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019    Boston, MA 02111-1307, USA.
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   //  Certificate Cache methods
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   /* Certificate Authorities */
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   //  Certificate Home methods
00114   //
00115 
00116 private:
00117 
00118   void cacheClearList();
00119   void cacheSaveToDisk();
00120   void cacheLoadDefaultPolicies();
00121 
00122   // for the cache portion:
00123   KSimpleConfig *cfg;
00124   QPtrList<KSSLCNode> certList;
00125 
00126   // Our pointer to OpenSSL
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
KDE Logo
This file is part of the documentation for kio Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 30 05:18:27 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2003