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

tdeio/kssl

  • tdeio
  • kssl
ksslx509v3.cpp
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#ifdef HAVE_CONFIG_H
22#include <config.h>
23#endif
24
25#include "ksslx509v3.h"
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() {
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() {
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 (false || ((1 << (16+X509_PURPOSE_ANY-1)) &&
58 (certTypeSSLServer() ||
59 certTypeSSLClient() ||
60 certTypeNSSSLServer())));
61#endif
62 return false;
63}
64
65
66bool KSSLX509V3::certTypeEmailCA() {
67#ifdef KSSL_HAVE_SSL
68 return (flags & ((1 << (16+X509_PURPOSE_SMIME_ENCRYPT-1))|
69 (1 << (16+X509_PURPOSE_SMIME_SIGN-1)))) ? true :
70 (false || ((1 << (16+X509_PURPOSE_ANY-1)) &&
71 certTypeSMIME()));
72#endif
73 return false;
74}
75
76
77bool KSSLX509V3::certTypeCodeCA() {
78#ifdef KSSL_HAVE_SSL
79 return (flags & (1 << (16+X509_PURPOSE_ANY-1))) ? true : false;
80#endif
81 return false;
82}
83
84
85bool KSSLX509V3::certTypeSSLClient() {
86#ifdef KSSL_HAVE_SSL
87 return (flags & (1 << (X509_PURPOSE_SSL_CLIENT-1))) ? true : false;
88#endif
89 return false;
90}
91
92
93bool KSSLX509V3::certTypeSSLServer() {
94#ifdef KSSL_HAVE_SSL
95 return (flags & (1 << (X509_PURPOSE_SSL_SERVER-1))) ? true : false;
96#endif
97 return false;
98}
99
100
101bool KSSLX509V3::certTypeNSSSLServer() {
102#ifdef KSSL_HAVE_SSL
103 return (flags & (1 << (X509_PURPOSE_NS_SSL_SERVER-1))) ? true : false;
104#endif
105 return false;
106}
107
108
109bool KSSLX509V3::certTypeSMIME() {
110#ifdef KSSL_HAVE_SSL
111 return certTypeSMIMEEncrypt()||certTypeSMIMESign();
112#endif
113 return false;
114}
115
116
117bool KSSLX509V3::certTypeSMIMEEncrypt() {
118#ifdef KSSL_HAVE_SSL
119 return (flags & (1 << (X509_PURPOSE_SMIME_ENCRYPT-1))) ? true : false;
120#endif
121 return false;
122}
123
124
125bool KSSLX509V3::certTypeSMIMESign() {
126#ifdef KSSL_HAVE_SSL
127 return (flags & (1 << (X509_PURPOSE_SMIME_SIGN-1))) ? true : false;
128#endif
129 return false;
130}
131
132
133bool KSSLX509V3::certTypeCRLSign() {
134#ifdef KSSL_HAVE_SSL
135 return (flags & (1 << (X509_PURPOSE_CRL_SIGN-1))) ? true : false;
136#endif
137 return false;
138}
139
140
141
142
143
KSSLX509V3::certTypeSMIMESign
bool certTypeSMIMESign()
Determine if this certificate can be used for S/MIME signing.
Definition: ksslx509v3.cpp:125
KSSLX509V3::certTypeSSLClient
bool certTypeSSLClient()
Determine if this certificate can be used by an SSL client.
Definition: ksslx509v3.cpp:85
KSSLX509V3::certTypeNSSSLServer
bool certTypeNSSSLServer()
Determine if this certificate can be used by a Netscape SSL server.
Definition: ksslx509v3.cpp:101
KSSLX509V3::certTypeSMIME
bool certTypeSMIME()
Determine if this certificate can be used for S/MIME.
Definition: ksslx509v3.cpp:109
KSSLX509V3::certTypeEmailCA
bool certTypeEmailCA()
Determine if this certificate can be used by an S/MIME signer.
Definition: ksslx509v3.cpp:66
KSSLX509V3::certTypeCodeCA
bool certTypeCodeCA()
Determine if this certificate can be used by a code certificate signer.
Definition: ksslx509v3.cpp:77
KSSLX509V3::certTypeCA
bool certTypeCA()
Determine if this certificate can be used by a certificate authority.
Definition: ksslx509v3.cpp:43
KSSLX509V3::certTypeSSLCA
bool certTypeSSLCA()
Determine if this certificate can be used by an SSL signer.
Definition: ksslx509v3.cpp:52
KSSLX509V3::certTypeSMIMEEncrypt
bool certTypeSMIMEEncrypt()
Determine if this certificate can be used for S/MIME encryption.
Definition: ksslx509v3.cpp:117
KSSLX509V3::certTypeSSLServer
bool certTypeSSLServer()
Determine if this certificate can be used by an SSL server.
Definition: ksslx509v3.cpp:93
KSSLX509V3::certTypeCRLSign
bool certTypeCRLSign()
Determine if this certificate can be used for revocation signing.
Definition: ksslx509v3.cpp:133
KSSLX509V3::~KSSLX509V3
~KSSLX509V3()
Destroy this object.
Definition: ksslx509v3.cpp:35

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.