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

KDECore

  • 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
28struct 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
57class OrgKdeKSSLDInterface; // aka org::kde::KSSLDInterface
58namespace org { namespace kde {
59typedef ::OrgKdeKSSLDInterface KSSLDInterface;
60}}
61
62class KSslCertificateManagerPrivate
63{
64public:
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
97KDECORE_EXPORT QList<KSslCaCertificate> _allKsslCaCertificates(KSslCertificateManager *cm);
98KDECORE_EXPORT void _setAllKsslCaCertificates(KSslCertificateManager *cm,
99 const QList<KSslCaCertificate> &certsIn);
100
101#endif //KSSLCERTIFICATEMANAGER_P_H
KConfig
The central class of the KDE configuration data system.
Definition: kconfig.h:71
KSslCertificateManagerPrivate
Definition: ksslcertificatemanager_p.h:63
KSslCertificateManagerPrivate::setCertificateBlacklisted
bool setCertificateBlacklisted(const QByteArray &certHash, bool isBlacklisted)
Definition: ksslcertificatemanager.cpp:420
KSslCertificateManagerPrivate::updateCertificateBlacklisted
bool updateCertificateBlacklisted(const KSslCaCertificate &cert)
Definition: ksslcertificatemanager.cpp:414
KSslCertificateManagerPrivate::loadDefaultCaCertificates
void loadDefaultCaCertificates()
Definition: ksslcertificatemanager.cpp:225
KSslCertificateManagerPrivate::certListMutex
QMutex certListMutex
Definition: ksslcertificatemanager_p.h:91
KSslCertificateManagerPrivate::setAllCertificates
void setAllCertificates(const QList< KSslCaCertificate > &certsIn)
Definition: ksslcertificatemanager.cpp:345
KSslCertificateManagerPrivate::config
KConfig config
Definition: ksslcertificatemanager_p.h:82
KSslCertificateManagerPrivate::addCertificate
bool addCertificate(const KSslCaCertificate &in)
Definition: ksslcertificatemanager.cpp:252
KSslCertificateManagerPrivate::userCertDir
QString userCertDir
Definition: ksslcertificatemanager_p.h:93
KSslCertificateManagerPrivate::removeCertificate
bool removeCertificate(const KSslCaCertificate &old)
Definition: ksslcertificatemanager.cpp:285
KSslCertificateManagerPrivate::sslErrorToString
QHash< KSslError::Error, QString > sslErrorToString
Definition: ksslcertificatemanager_p.h:85
KSslCertificateManagerPrivate::get
static KSslCertificateManagerPrivate * get(KSslCertificateManager *q)
Definition: ksslcertificatemanager_p.h:68
KSslCertificateManagerPrivate::stringToSslError
QHash< QString, KSslError::Error > stringToSslError
Definition: ksslcertificatemanager_p.h:84
KSslCertificateManagerPrivate::allCertificates
QList< KSslCaCertificate > allCertificates() const
Definition: ksslcertificatemanager.cpp:388
KSslCertificateManagerPrivate::~KSslCertificateManagerPrivate
~KSslCertificateManagerPrivate()
Definition: ksslcertificatemanager.cpp:219
KSslCertificateManagerPrivate::knownCerts
QSet< QByteArray > knownCerts
Definition: ksslcertificatemanager_p.h:90
KSslCertificateManagerPrivate::defaultCaCertificates
QList< QSslCertificate > defaultCaCertificates
Definition: ksslcertificatemanager_p.h:87
KSslCertificateManagerPrivate::iface
org::kde::KSSLDInterface * iface
Definition: ksslcertificatemanager_p.h:83
KSslCertificateManagerPrivate::KSslCertificateManagerPrivate
KSslCertificateManagerPrivate()
Definition: ksslcertificatemanager.cpp:207
KSslCertificateManagerPrivate::isCertListLoaded
bool isCertListLoaded
Definition: ksslcertificatemanager_p.h:92
KSslCertificateManager
Definition: ksslcertificatemanager.h:65
OrgKdeKSSLDInterface
Definition: kssld_interface.h:39
QHash
Definition: ksycocafactory.h:28
QList
Definition: kaboutdata.h:33
QSet
Definition: k3resolver.h:41
QString
kconfig.h
_allKsslCaCertificates
QList< KSslCaCertificate > _allKsslCaCertificates(KSslCertificateManager *cm)
Definition: ksslcertificatemanager.cpp:523
_setAllKsslCaCertificates
void _setAllKsslCaCertificates(KSslCertificateManager *cm, const QList< KSslCaCertificate > &certsIn)
Definition: ksslcertificatemanager.cpp:528
org::kde::KSSLDInterface
::OrgKdeKSSLDInterface KSSLDInterface
Definition: ksslcertificatemanager_p.h:59
org
Definition: ksslcertificatemanager_p.h:58
KSslCaCertificate
Definition: ksslcertificatemanager_p.h:29
KSslCaCertificate::certHash
const QByteArray certHash
Definition: ksslcertificatemanager_p.h:43
KSslCaCertificate::operator=
const KSslCaCertificate & operator=(const KSslCaCertificate &other)
Definition: ksslcertificatemanager_p.h:47
KSslCaCertificate::store
const Store store
Definition: ksslcertificatemanager_p.h:44
KSslCaCertificate::cert
const QSslCertificate cert
Definition: ksslcertificatemanager_p.h:42
KSslCaCertificate::Store
Store
Definition: ksslcertificatemanager_p.h:30
KSslCaCertificate::SystemStore
@ SystemStore
Definition: ksslcertificatemanager_p.h:31
KSslCaCertificate::UserStore
@ UserStore
Definition: ksslcertificatemanager_p.h:32
KSslCaCertificate::isBlacklisted
bool isBlacklisted
Definition: ksslcertificatemanager_p.h:45
KSslCaCertificate::KSslCaCertificate
KSslCaCertificate(const QSslCertificate &c, Store s, bool _isBlacklisted)
Definition: ksslcertificatemanager_p.h:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
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