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

KIO

  • kio
  • kssl
ksslx509v3.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2 *
3 * Copyright (C) 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#include "ksslx509v3.h"
22
23#include <config.h>
24#include <ksslconfig.h>
25
26#include <kopenssl.h>
27#include <kdebug.h>
28
29
30KSSLX509V3::KSSLX509V3() {
31 flags = 0;
32}
33
34
35KSSLX509V3::~KSSLX509V3() {
36}
37
38
39/* When reading this, please remember that
40 * !A || B is logically equivalent to A => B
41 */
42
43bool KSSLX509V3::certTypeCA() const {
44#ifdef KSSL_HAVE_SSL
45 // First try CA without X509_PURPOSE_ANY CA, then just try SSLCA
46 return (flags & (65471L << 16)) ? true : certTypeSSLCA();
47#endif
48 return false;
49}
50
51
52bool KSSLX509V3::certTypeSSLCA() const {
53#ifdef KSSL_HAVE_SSL
54 return (flags & ((1 << (16+X509_PURPOSE_NS_SSL_SERVER-1))|
55 (1 << (16+X509_PURPOSE_SSL_SERVER-1))|
56 (1 << (16+X509_PURPOSE_SSL_CLIENT-1)))) ? true :
57 ( certTypeSSLServer() ||
58 certTypeSSLClient() ||
59 certTypeNSSSLServer());
60#endif
61 return false;
62}
63
64
65bool KSSLX509V3::certTypeEmailCA() const {
66#ifdef KSSL_HAVE_SSL
67 return (flags & ((1 << (16+X509_PURPOSE_SMIME_ENCRYPT-1))|
68 (1 << (16+X509_PURPOSE_SMIME_SIGN-1)))) ? true :
69 certTypeSMIME();
70#endif
71 return false;
72}
73
74
75bool KSSLX509V3::certTypeCodeCA() const {
76#ifdef KSSL_HAVE_SSL
77 return (flags & (1 << (16+X509_PURPOSE_ANY-1))) ? true : false;
78#endif
79 return false;
80}
81
82
83bool KSSLX509V3::certTypeSSLClient() const {
84#ifdef KSSL_HAVE_SSL
85 return (flags & (1 << (X509_PURPOSE_SSL_CLIENT-1))) ? true : false;
86#endif
87 return false;
88}
89
90
91bool KSSLX509V3::certTypeSSLServer() const {
92#ifdef KSSL_HAVE_SSL
93 return (flags & (1 << (X509_PURPOSE_SSL_SERVER-1))) ? true : false;
94#endif
95 return false;
96}
97
98
99bool KSSLX509V3::certTypeNSSSLServer() const {
100#ifdef KSSL_HAVE_SSL
101 return (flags & (1 << (X509_PURPOSE_NS_SSL_SERVER-1))) ? true : false;
102#endif
103 return false;
104}
105
106
107bool KSSLX509V3::certTypeSMIME() const {
108#ifdef KSSL_HAVE_SSL
109 return certTypeSMIMEEncrypt()||certTypeSMIMESign();
110#endif
111 return false;
112}
113
114
115bool KSSLX509V3::certTypeSMIMEEncrypt() const {
116#ifdef KSSL_HAVE_SSL
117 return (flags & (1 << (X509_PURPOSE_SMIME_ENCRYPT-1))) ? true : false;
118#endif
119 return false;
120}
121
122
123bool KSSLX509V3::certTypeSMIMESign() const {
124#ifdef KSSL_HAVE_SSL
125 return (flags & (1 << (X509_PURPOSE_SMIME_SIGN-1))) ? true : false;
126#endif
127 return false;
128}
129
130
131bool KSSLX509V3::certTypeCRLSign() const {
132#ifdef KSSL_HAVE_SSL
133 return (flags & (1 << (X509_PURPOSE_CRL_SIGN-1))) ? true : false;
134#endif
135 return false;
136}
137
138
139
140
141
KSSLX509V3::flags
long flags
Definition: ksslx509v3.h:118
KSSLX509V3::certTypeEmailCA
bool certTypeEmailCA() const
Determine if this certificate can be used by an S/MIME signer.
Definition: ksslx509v3.cpp:65
KSSLX509V3::certTypeSSLServer
bool certTypeSSLServer() const
Determine if this certificate can be used by an SSL server.
Definition: ksslx509v3.cpp:91
KSSLX509V3::certTypeSMIME
bool certTypeSMIME() const
Determine if this certificate can be used for S/MIME.
Definition: ksslx509v3.cpp:107
KSSLX509V3::certTypeSSLClient
bool certTypeSSLClient() const
Determine if this certificate can be used by an SSL client.
Definition: ksslx509v3.cpp:83
KSSLX509V3::certTypeSSLCA
bool certTypeSSLCA() const
Determine if this certificate can be used by an SSL signer.
Definition: ksslx509v3.cpp:52
KSSLX509V3::certTypeCA
bool certTypeCA() const
Determine if this certificate can be used by a certificate authority.
Definition: ksslx509v3.cpp:43
KSSLX509V3::certTypeSMIMESign
bool certTypeSMIMESign() const
Determine if this certificate can be used for S/MIME signing.
Definition: ksslx509v3.cpp:123
KSSLX509V3::certTypeSMIMEEncrypt
bool certTypeSMIMEEncrypt() const
Determine if this certificate can be used for S/MIME encryption.
Definition: ksslx509v3.cpp:115
KSSLX509V3::KSSLX509V3
KSSLX509V3()
Definition: ksslx509v3.cpp:30
KSSLX509V3::certTypeNSSSLServer
bool certTypeNSSSLServer() const
Determine if this certificate can be used by a Netscape SSL server.
Definition: ksslx509v3.cpp:99
KSSLX509V3::~KSSLX509V3
~KSSLX509V3()
Destroy this object.
Definition: ksslx509v3.cpp:35
KSSLX509V3::certTypeCodeCA
bool certTypeCodeCA() const
Determine if this certificate can be used by a code certificate signer.
Definition: ksslx509v3.cpp:75
KSSLX509V3::certTypeCRLSign
bool certTypeCRLSign() const
Determine if this certificate can be used for revocation signing.
Definition: ksslx509v3.cpp:131
kdebug.h
kopenssl.h
ksslx509v3.h
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.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • 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