File indexing completed on 2024-04-14 14:20:34

0001 /* This file is part of the KDE project
0002  *
0003  * Copyright (C) 2001-2003 George Staikos <staikos@kde.org>
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Library General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, write to
0017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019  */
0020 
0021 #ifndef _KSSLX509V3_H
0022 #define _KSSLX509V3_H
0023 
0024 #include <QString>
0025 
0026 #include <kdelibs4support_export.h>
0027 
0028 /**
0029  * KDE X509v3 Flag Class
0030  *
0031  * This class is used to track X509v3 flags for
0032  *
0033  * @author George Staikos <staikos@kde.org>
0034  * @see KExtendedSocket, TCPSlaveBase
0035  * @short KDE SSL Class
0036  */
0037 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KSSLX509V3
0038 {
0039     friend class KSSLCertificate;
0040     friend class KSSLCertificatePrivate;
0041 public:
0042     /**
0043      *  Destroy this object
0044      */
0045     ~KSSLX509V3();
0046 
0047     /**
0048      *  Determine if this certificate can be used by a certificate authority
0049      *  @return true if it can be used by a certificate authority
0050      */
0051     bool certTypeCA() const;
0052 
0053     /**
0054      *  Determine if this certificate can be used by an SSL signer
0055      *  @return true if it can be used by an SSL signer
0056      */
0057     bool certTypeSSLCA() const;
0058 
0059     /**
0060      *  Determine if this certificate can be used by an S/MIME signer
0061      *  @return true if it can be used by an S/MIME signer
0062      */
0063     bool certTypeEmailCA() const;
0064 
0065     /**
0066      *  Determine if this certificate can be used by a code certificate signer
0067      *  @return true if it can be used by a code certificate signer
0068      */
0069     bool certTypeCodeCA() const;
0070 
0071     /**
0072      *  Determine if this certificate can be used by an SSL client
0073      *  @return true if it can be used by an SSL client
0074      */
0075     bool certTypeSSLClient() const;
0076 
0077     /**
0078      *  Determine if this certificate can be used by an SSL server
0079      *  @return true if it can be used by an SSL server
0080      */
0081     bool certTypeSSLServer() const;
0082 
0083     /**
0084      *  Determine if this certificate can be used by a Netscape SSL server
0085      *  @return true if it can be used by a Netscape SSL server
0086      */
0087     bool certTypeNSSSLServer() const;
0088 
0089     /**
0090      *  Determine if this certificate can be used for S/MIME
0091      *  @return true if it can be used for S/MIME
0092      */
0093     bool certTypeSMIME() const;
0094 
0095     /**
0096      *  Determine if this certificate can be used for S/MIME encryption
0097      *  @return true if it can be used for S/MIME encryption
0098      */
0099     bool certTypeSMIMEEncrypt() const;
0100 
0101     /**
0102      *  Determine if this certificate can be used for S/MIME signing
0103      *  @return true if it can be used for S/MIME signing
0104      */
0105     bool certTypeSMIMESign() const;
0106 
0107     /**
0108      *  Determine if this certificate can be used for revocation signing
0109      *  @return true if it can be used for revocation signing
0110      */
0111     bool certTypeCRLSign() const;
0112 
0113 private:
0114     class KSSLX509V3Private;
0115     KSSLX509V3Private *d;
0116 
0117 protected:
0118     KSSLX509V3();
0119     long flags;  // warning: this is only valid for up to 16 flags + 16 CA.
0120 };
0121 
0122 #endif