1 /* This file is part of the KDE project
2  *
3  * Copyright (C) 2001-2003 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 _KSSLX509V3_H
22 #define _KSSLX509V3_H
23 
24 #include <QString>
25 
26 #include <kdelibs4support_export.h>
27 
28 /**
29  * KDE X509v3 Flag Class
30  *
31  * This class is used to track X509v3 flags for
32  *
33  * @author George Staikos <staikos@kde.org>
34  * @see KExtendedSocket, TCPSlaveBase
35  * @short KDE SSL Class
36  */
37 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KSSLX509V3
38 {
39     friend class KSSLCertificate;
40     friend class KSSLCertificatePrivate;
41 public:
42     /**
43      *  Destroy this object
44      */
45     ~KSSLX509V3();
46 
47     /**
48      *  Determine if this certificate can be used by a certificate authority
49      *  @return true if it can be used by a certificate authority
50      */
51     bool certTypeCA() const;
52 
53     /**
54      *  Determine if this certificate can be used by an SSL signer
55      *  @return true if it can be used by an SSL signer
56      */
57     bool certTypeSSLCA() const;
58 
59     /**
60      *  Determine if this certificate can be used by an S/MIME signer
61      *  @return true if it can be used by an S/MIME signer
62      */
63     bool certTypeEmailCA() const;
64 
65     /**
66      *  Determine if this certificate can be used by a code certificate signer
67      *  @return true if it can be used by a code certificate signer
68      */
69     bool certTypeCodeCA() const;
70 
71     /**
72      *  Determine if this certificate can be used by an SSL client
73      *  @return true if it can be used by an SSL client
74      */
75     bool certTypeSSLClient() const;
76 
77     /**
78      *  Determine if this certificate can be used by an SSL server
79      *  @return true if it can be used by an SSL server
80      */
81     bool certTypeSSLServer() const;
82 
83     /**
84      *  Determine if this certificate can be used by a Netscape SSL server
85      *  @return true if it can be used by a Netscape SSL server
86      */
87     bool certTypeNSSSLServer() const;
88 
89     /**
90      *  Determine if this certificate can be used for S/MIME
91      *  @return true if it can be used for S/MIME
92      */
93     bool certTypeSMIME() const;
94 
95     /**
96      *  Determine if this certificate can be used for S/MIME encryption
97      *  @return true if it can be used for S/MIME encryption
98      */
99     bool certTypeSMIMEEncrypt() const;
100 
101     /**
102      *  Determine if this certificate can be used for S/MIME signing
103      *  @return true if it can be used for S/MIME signing
104      */
105     bool certTypeSMIMESign() const;
106 
107     /**
108      *  Determine if this certificate can be used for revocation signing
109      *  @return true if it can be used for revocation signing
110      */
111     bool certTypeCRLSign() const;
112 
113 private:
114     class KSSLX509V3Private;
115     KSSLX509V3Private *d;
116 
117 protected:
118     KSSLX509V3();
119     long flags;  // warning: this is only valid for up to 16 flags + 16 CA.
120 };
121 
122 #endif
123