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 caAddFromFile(
QString filename,
bool ssl,
bool email,
bool code);
00103
00104
bool caRemove(
QString subject);
00105
00106
bool caRemoveFromFile(
QString filename);
00107
00108
QString caGetCert(
QString subject);
00109
00110
bool caSetUse(
QString subject,
bool ssl,
bool email,
bool code);
00111
00112
QStringList getKDEKeyByEmail(
const QString &email);
00113
00114
KSSLCertificate getCertByMD5Digest(
const QString &key);
00115
00116
00117
00118
00119
00120
QStringList getHomeCertificateList();
00121
00122
bool addHomeCertificateFile(
QString filename,
QString password,
bool storePass );
00123
00124
bool addHomeCertificatePKCS12(
QString base64cert,
QString passToStore);
00125
00126
bool deleteHomeCertificateByFile(
QString filename,
QString password);
00127
00128
bool deleteHomeCertificateByPKCS12(
QString base64cert,
QString password);
00129
00130
bool deleteHomeCertificateByName(
QString name);
00131
00132
private:
00133
00134
void cacheClearList();
00135
void cacheSaveToDisk();
00136
void cacheLoadDefaultPolicies();
00137
00138
00139
KSimpleConfig *cfg;
00140
QPtrList<KSSLCNode> certList;
00141
00142
00143
KOpenSSLProxy *kossl;
00144
00145
00146
void searchAddCert(
KSSLCertificate *cert);
00147
void searchRemoveCert(
KSSLCertificate *cert);
00148
00149
QMap<QString, QPtrVector<KSSLCertificate> > skEmail;
00150
QMap<QString, KSSLCertificate *> skMD5Digest;
00151 };
00152
00153
00154
#endif