You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
155 lines
4.1 KiB
155 lines
4.1 KiB
15 years ago
|
/*
|
||
|
This file is part of the KDE libraries
|
||
|
|
||
|
Copyright (c) 2001-2005 George Staikos <staikos@kde.org>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
|
||
|
*/
|
||
|
#ifndef __KSSLD_H__
|
||
|
#define __KSSLD_H__
|
||
|
|
||
|
#include <kded/kdedmodule.h>
|
||
|
#include <ksslcertificate.h>
|
||
|
#include <ksslcertificatecache.h>
|
||
15 years ago
|
#include <tqstring.h>
|
||
|
#include <tqstringlist.h>
|
||
|
#include <tqvaluelist.h>
|
||
|
#include <tqmap.h>
|
||
|
#include <tqptrvector.h>
|
||
15 years ago
|
|
||
|
|
||
|
class KSimpleConfig;
|
||
|
class KSSLCNode;
|
||
|
class KOpenSSLProxy;
|
||
|
|
||
|
class KSSLD : public KDEDModule
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
K_DCOP
|
||
|
|
||
|
public:
|
||
|
|
||
15 years ago
|
KSSLD(const TQCString &name);
|
||
15 years ago
|
|
||
|
virtual ~KSSLD();
|
||
|
|
||
|
k_dcop:
|
||
|
//
|
||
|
// Certificate Cache methods
|
||
|
//
|
||
|
void cacheAddCertificate(KSSLCertificate cert,
|
||
|
KSSLCertificateCache::KSSLCertificatePolicy policy,
|
||
|
bool permanent = true);
|
||
15 years ago
|
KSSLCertificateCache::KSSLCertificatePolicy cacheGetPolicyByCN(TQString cn);
|
||
15 years ago
|
|
||
|
KSSLCertificateCache::KSSLCertificatePolicy cacheGetPolicyByCertificate(KSSLCertificate cert);
|
||
|
|
||
15 years ago
|
bool cacheSeenCN(TQString cn);
|
||
15 years ago
|
bool cacheSeenCertificate(KSSLCertificate cert);
|
||
|
|
||
15 years ago
|
bool cacheRemoveByCN(TQString cn);
|
||
|
bool cacheRemoveBySubject(TQString subject);
|
||
15 years ago
|
bool cacheRemoveByCertificate(KSSLCertificate cert);
|
||
|
|
||
|
bool cacheIsPermanent(KSSLCertificate cert);
|
||
|
|
||
|
void cacheReload();
|
||
|
|
||
15 years ago
|
bool cacheModifyByCN(TQString cn,
|
||
15 years ago
|
KSSLCertificateCache::KSSLCertificatePolicy policy,
|
||
|
bool permanent,
|
||
15 years ago
|
TQDateTime expires);
|
||
15 years ago
|
|
||
|
bool cacheModifyByCertificate(KSSLCertificate cert,
|
||
|
KSSLCertificateCache::KSSLCertificatePolicy policy,
|
||
|
bool permanent,
|
||
15 years ago
|
TQDateTime expires);
|
||
15 years ago
|
|
||
15 years ago
|
TQStringList cacheGetHostList(KSSLCertificate cert);
|
||
15 years ago
|
|
||
15 years ago
|
bool cacheAddHost(KSSLCertificate cert, TQString host);
|
||
15 years ago
|
|
||
15 years ago
|
bool cacheRemoveHost(KSSLCertificate cert, TQString host);
|
||
15 years ago
|
|
||
|
/* Certificate Authorities */
|
||
|
void caVerifyUpdate();
|
||
|
bool caRegenerate();
|
||
|
|
||
15 years ago
|
TQStringList caList();
|
||
15 years ago
|
|
||
15 years ago
|
bool caUseForSSL(TQString subject);
|
||
15 years ago
|
|
||
15 years ago
|
bool caUseForEmail(TQString subject);
|
||
15 years ago
|
|
||
15 years ago
|
bool caUseForCode(TQString subject);
|
||
15 years ago
|
|
||
15 years ago
|
bool caAdd(TQString certificate, bool ssl, bool email, bool code);
|
||
15 years ago
|
|
||
15 years ago
|
bool caAddFromFile(TQString filename, bool ssl, bool email, bool code);
|
||
15 years ago
|
|
||
15 years ago
|
bool caRemove(TQString subject);
|
||
15 years ago
|
|
||
15 years ago
|
bool caRemoveFromFile(TQString filename);
|
||
15 years ago
|
|
||
15 years ago
|
TQString caGetCert(TQString subject);
|
||
15 years ago
|
|
||
15 years ago
|
bool caSetUse(TQString subject, bool ssl, bool email, bool code);
|
||
15 years ago
|
|
||
15 years ago
|
TQStringList getKDEKeyByEmail(const TQString &email);
|
||
15 years ago
|
|
||
15 years ago
|
KSSLCertificate getCertByMD5Digest(const TQString &key);
|
||
15 years ago
|
|
||
|
//
|
||
|
// Certificate Home methods
|
||
|
//
|
||
|
|
||
15 years ago
|
TQStringList getHomeCertificateList();
|
||
15 years ago
|
|
||
15 years ago
|
bool addHomeCertificateFile(TQString filename, TQString password, bool storePass /*=false*/);
|
||
15 years ago
|
|
||
15 years ago
|
bool addHomeCertificatePKCS12(TQString base64cert, TQString passToStore);
|
||
15 years ago
|
|
||
15 years ago
|
bool deleteHomeCertificateByFile(TQString filename, TQString password);
|
||
15 years ago
|
|
||
15 years ago
|
bool deleteHomeCertificateByPKCS12(TQString base64cert, TQString password);
|
||
15 years ago
|
|
||
15 years ago
|
bool deleteHomeCertificateByName(TQString name);
|
||
15 years ago
|
|
||
|
private:
|
||
|
|
||
|
void cacheClearList();
|
||
|
void cacheSaveToDisk();
|
||
|
void cacheLoadDefaultPolicies();
|
||
|
|
||
|
// for the cache portion:
|
||
|
KSimpleConfig *cfg;
|
||
15 years ago
|
TQPtrList<KSSLCNode> certList;
|
||
15 years ago
|
|
||
|
// Our pointer to OpenSSL
|
||
|
KOpenSSLProxy *kossl;
|
||
|
|
||
|
//
|
||
|
void searchAddCert(KSSLCertificate *cert);
|
||
|
void searchRemoveCert(KSSLCertificate *cert);
|
||
|
|
||
15 years ago
|
TQMap<TQString, TQPtrVector<KSSLCertificate> > skEmail;
|
||
|
TQMap<TQString, KSSLCertificate *> skMD5Digest;
|
||
15 years ago
|
};
|
||
|
|
||
|
|
||
|
#endif
|