• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/kssl
 

tdeio/kssl

  • tdeio
  • kssl
ksslcertificatecache.h
1/* This file is part of the KDE project
2 *
3 * Copyright (C) 2000, 2001 George Staikos <staikos@kde.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef _INCLUDE_KSSLCCACHE_H
22#define _INCLUDE_KSSLCCACHE_H
23
24class KSSLCertificate;
25#include <tqstring.h>
26#include <tqstringlist.h>
27#include <tqdatetime.h>
28
29#include <tdelibs_export.h>
30
31class TDEIO_EXPORT KSSLCertificateCache {
32public:
33
34enum KSSLCertificatePolicy { Unknown, Reject, Accept, Prompt, Ambiguous };
35// Unknown: no policy has been set for this record
36// Reject: user has requested to not accept data from this site
37// Accept: user has requested to always accept data from this site
38// Prompt: user wishes to be prompted before accepting this certificate
39// You may need to set a [non-]permanent policy on this record after
40// the user is prompted.
41// Ambiguous: The state cannot be uniquely determined. Hopefully this
42// doesn't happen.
43
44 KSSLCertificateCache();
45 ~KSSLCertificateCache();
46
47 void addCertificate(KSSLCertificate& cert, KSSLCertificatePolicy policy,
48 bool permanent = true);
49
50 // WARNING! This is not a "secure" method. You need to actually
51 // do a getPolicyByCertificate to be cryptographically sure
52 // that this is an accepted certificate/site pair.
53 // (note that the site (CN) is encoded in the certificate
54 // so you should only accept certificates whose CN matches
55 // the exact FQDN of the site presenting it)
56 // If you're just doing an OpenSSL connection, I believe it
57 // tests this for you, but don't take my word for it.
58 KSSLCertificatePolicy getPolicyByCN(TQString& cn);
59
60 KSSLCertificatePolicy getPolicyByCertificate(KSSLCertificate& cert);
61
62 bool seenCN(TQString& cn);
63 bool seenCertificate(KSSLCertificate& cert);
64
65 bool removeByCN(TQString& cn);
66 bool removeByCertificate(KSSLCertificate& cert);
67
68 bool isPermanent(KSSLCertificate& cert);
69
70 bool modifyByCN(TQString& cn,
71 KSSLCertificateCache::KSSLCertificatePolicy policy,
72 bool permanent,
73 TQDateTime& expires);
74
75 bool modifyByCertificate(KSSLCertificate& cert,
76 KSSLCertificateCache::KSSLCertificatePolicy policy,
77 bool permanent,
78 TQDateTime& expires);
79
80 TQStringList getHostList(KSSLCertificate& cert);
81 bool addHost(KSSLCertificate& cert, TQString& host);
82 bool removeHost(KSSLCertificate& cert, TQString& host);
83
84 // SMIME
85 TQStringList getKDEKeyByEmail(const TQString &email);
86 KSSLCertificate *getCertByMD5Digest(const TQString &key);
87
88 void reload();
89
90 // You shouldn't need to call this but in some weird circumstances
91 // it might be necessary.
92 void saveToDisk();
93
94private:
95 class KSSLCertificateCachePrivate;
96 KSSLCertificateCachePrivate *d;
97
98 void loadDefaultPolicies();
99 void clearList();
100
101};
102
103
104TDEIO_EXPORT TQDataStream& operator<<(TQDataStream& s, const KSSLCertificateCache::KSSLCertificatePolicy& p);
105TDEIO_EXPORT TQDataStream& operator>>(TQDataStream& s, KSSLCertificateCache::KSSLCertificatePolicy& p);
106
107#endif
KSSLCertificate
KDE X.509 Certificate.
Definition: ksslcertificate.h:77

tdeio/kssl

Skip menu "tdeio/kssl"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeio/kssl

Skip menu "tdeio/kssl"
  • 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 tdeio/kssl by doxygen 1.9.4
This website is maintained by Timothy Pearson.