• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • sources
  • kde-4.14
  • kdelibs
  • kdecore
  • network
ksslcertificatemanager_p.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  *
3  * Copyright (C) 2010 Andreas Hartmetz <ahartmetz@gmail.com>
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 KSSLCERTIFICATEMANAGER_P_H
22 #define KSSLCERTIFICATEMANAGER_P_H
23 
24 #include <QMutex>
25 
26 #include "kconfig.h"
27 
28 struct KSslCaCertificate
29 {
30  enum Store {
31  SystemStore = 0,
32  UserStore
33  };
34 
35  // TODO see if we can get rid of the .toHex() for storage and comparison; requires
36  // several changes in KSslCertificateManager and CaCertificatesPage!
37  KSslCaCertificate(const QSslCertificate &c, Store s, bool _isBlacklisted)
38  : cert(c),
39  certHash(c.digest().toHex()),
40  store(s),
41  isBlacklisted(_isBlacklisted) { }
42  const QSslCertificate cert;
43  const QByteArray certHash;
44  const Store store;
45  bool isBlacklisted;
46  // the synthesized version without the const_casts doesn't compile
47  const KSslCaCertificate &operator=(const KSslCaCertificate &other)
48  {
49  const_cast<QSslCertificate &>(cert) = other.cert;
50  const_cast<QByteArray &>(certHash) = other.certHash;
51  const_cast<Store &>(store) = other.store;
52  isBlacklisted = other.isBlacklisted;
53  return *this;
54  }
55 };
56 
57 class OrgKdeKSSLDInterface; // aka org::kde::KSSLDInterface
58 namespace org { namespace kde {
59 typedef ::OrgKdeKSSLDInterface KSSLDInterface;
60 }}
61 
62 class KSslCertificateManagerPrivate
63 {
64 public:
65  KSslCertificateManagerPrivate();
66  ~KSslCertificateManagerPrivate();
67 
68  static KSslCertificateManagerPrivate *get(KSslCertificateManager *q)
69  { return q->d; }
70 
71  void loadDefaultCaCertificates();
72 
73  // helpers for setAllCertificates()
74  bool addCertificate(const KSslCaCertificate &in);
75  bool removeCertificate(const KSslCaCertificate &old);
76  bool updateCertificateBlacklisted(const KSslCaCertificate &cert);
77  bool setCertificateBlacklisted(const QByteArray &certHash, bool isBlacklisted);
78 
79  void setAllCertificates(const QList<KSslCaCertificate> &certsIn);
80  QList<KSslCaCertificate> allCertificates() const;
81 
82  KConfig config;
83  org::kde::KSSLDInterface *iface;
84  QHash<QString, KSslError::Error> stringToSslError;
85  QHash<KSslError::Error, QString> sslErrorToString;
86 
87  QList<QSslCertificate> defaultCaCertificates;
88 
89  // for use in setAllCertificates() only
90  QSet<QByteArray> knownCerts;
91  QMutex certListMutex;
92  bool isCertListLoaded;
93  QString userCertDir;
94 };
95 
96 // don't export KSslCertificateManagerPrivate to avoid unnecessary symbols in libkdecore
97 KDECORE_EXPORT QList<KSslCaCertificate> _allKsslCaCertificates(KSslCertificateManager *cm);
98 KDECORE_EXPORT void _setAllKsslCaCertificates(KSslCertificateManager *cm,
99  const QList<KSslCaCertificate> &certsIn);
100 
101 #endif //KSSLCERTIFICATEMANAGER_P_H
KSslCertificateManagerPrivate::setAllCertificates
void setAllCertificates(const QList< KSslCaCertificate > &certsIn)
Definition: ksslcertificatemanager.cpp:345
KSslCaCertificate::certHash
const QByteArray certHash
Definition: ksslcertificatemanager_p.h:43
QMutex
KSslCertificateManagerPrivate::loadDefaultCaCertificates
void loadDefaultCaCertificates()
Definition: ksslcertificatemanager.cpp:225
KSslCertificateManagerPrivate::iface
org::kde::KSSLDInterface * iface
Definition: ksslcertificatemanager_p.h:83
QByteArray
OrgKdeKSSLDInterface
Definition: kssld_interface.h:38
kconfig.h
KSslCertificateManagerPrivate::isCertListLoaded
bool isCertListLoaded
Definition: ksslcertificatemanager_p.h:92
KSslCaCertificate::UserStore
Definition: ksslcertificatemanager_p.h:32
KSslCaCertificate::cert
const QSslCertificate cert
Definition: ksslcertificatemanager_p.h:42
KSslCaCertificate::isBlacklisted
bool isBlacklisted
Definition: ksslcertificatemanager_p.h:45
KSslCertificateManagerPrivate::setCertificateBlacklisted
bool setCertificateBlacklisted(const QByteArray &certHash, bool isBlacklisted)
Definition: ksslcertificatemanager.cpp:420
KSslCertificateManagerPrivate::allCertificates
QList< KSslCaCertificate > allCertificates() const
Definition: ksslcertificatemanager.cpp:388
_setAllKsslCaCertificates
void _setAllKsslCaCertificates(KSslCertificateManager *cm, const QList< KSslCaCertificate > &certsIn)
Definition: ksslcertificatemanager.cpp:528
KSslCertificateManager
Definition: ksslcertificatemanager.h:64
KSslCertificateManagerPrivate
Definition: ksslcertificatemanager_p.h:62
KSslCertificateManagerPrivate::knownCerts
QSet< QByteArray > knownCerts
Definition: ksslcertificatemanager_p.h:90
KSslCaCertificate::store
const Store store
Definition: ksslcertificatemanager_p.h:44
QHash< QString, KSslError::Error >
KSslCertificateManagerPrivate::KSslCertificateManagerPrivate
KSslCertificateManagerPrivate()
Definition: ksslcertificatemanager.cpp:207
KSslCertificateManagerPrivate::removeCertificate
bool removeCertificate(const KSslCaCertificate &old)
Definition: ksslcertificatemanager.cpp:285
KSslCertificateManagerPrivate::defaultCaCertificates
QList< QSslCertificate > defaultCaCertificates
Definition: ksslcertificatemanager_p.h:87
KSslCertificateManagerPrivate::userCertDir
QString userCertDir
Definition: ksslcertificatemanager_p.h:93
KSslCaCertificate
Definition: ksslcertificatemanager_p.h:28
QSet< QByteArray >
KSslCaCertificate::SystemStore
Definition: ksslcertificatemanager_p.h:31
KSslCertificateManagerPrivate::certListMutex
QMutex certListMutex
Definition: ksslcertificatemanager_p.h:91
QString
QList
Definition: kaboutdata.h:33
_allKsslCaCertificates
QList< KSslCaCertificate > _allKsslCaCertificates(KSslCertificateManager *cm)
Definition: ksslcertificatemanager.cpp:523
KSslCertificateManagerPrivate::addCertificate
bool addCertificate(const KSslCaCertificate &in)
Definition: ksslcertificatemanager.cpp:252
KConfig
The central class of the KDE configuration data system.
Definition: kconfig.h:70
KSslCertificateManagerPrivate::~KSslCertificateManagerPrivate
~KSslCertificateManagerPrivate()
Definition: ksslcertificatemanager.cpp:219
KSslCaCertificate::Store
Store
Definition: ksslcertificatemanager_p.h:30
KSslCaCertificate::KSslCaCertificate
KSslCaCertificate(const QSslCertificate &c, Store s, bool _isBlacklisted)
Definition: ksslcertificatemanager_p.h:37
KSslCertificateManagerPrivate::stringToSslError
QHash< QString, KSslError::Error > stringToSslError
Definition: ksslcertificatemanager_p.h:84
KSslCertificateManagerPrivate::updateCertificateBlacklisted
bool updateCertificateBlacklisted(const KSslCaCertificate &cert)
Definition: ksslcertificatemanager.cpp:414
KSslCaCertificate::operator=
const KSslCaCertificate & operator=(const KSslCaCertificate &other)
Definition: ksslcertificatemanager_p.h:47
KSslCertificateManagerPrivate::sslErrorToString
QHash< KSslError::Error, QString > sslErrorToString
Definition: ksslcertificatemanager_p.h:85
org::kde::KSSLDInterface
::OrgKdeKSSLDInterface KSSLDInterface
Definition: ksslcertificatemanager_p.h:59
KSslCertificateManagerPrivate::config
KConfig config
Definition: ksslcertificatemanager_p.h:82
QSslCertificate
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal