home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / ksslcertchain.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  3.1 KB  |  137 lines

  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 _KSSLCERTCHAIN_H
  22. #define _KSSLCERTCHAIN_H
  23.  
  24. #include <qglobal.h>
  25. #include <qptrlist.h>
  26. #include <kdemacros.h>
  27.  
  28. class QString;
  29. class QCString;
  30. class KSSL;
  31. class KSSLCertChainPrivate;
  32. class QStringList;
  33.  
  34. #include <ksslcertificate.h>
  35.  
  36. /**
  37.  * KDE Certificate Chain Representation Class
  38.  *
  39.  * This class provides a representation for an X.509 certificate chain.
  40.  *
  41.  * @author George Staikos <staikos@kde.org>
  42.  * @see KSSL, KSSLCertificate, KSSLPeerInfo
  43.  * @short KDE X.509 Certificate Chain
  44.  */
  45. class KIO_EXPORT KSSLCertChain {
  46. friend class KSSL;
  47. friend class KSSLPeerInfo;
  48.  
  49. public:
  50.     /**
  51.      *  Construct a KSSLCertChain object
  52.      */
  53.     KSSLCertChain();
  54.  
  55.     /**
  56.      *  Destroy this KSSLCertChain object
  57.      */
  58.     ~KSSLCertChain();
  59.  
  60.     /**
  61.      *  Determine if this represents a valid certificate chain
  62.      *
  63.      *  @return true if it is a valid certificate chain
  64.      */
  65.     bool isValid();
  66.  
  67.     /**
  68.      *  Do a deep copy of the certificate chain.
  69.      *
  70.      *  @return pointer to a new certificate chain object
  71.      *
  72.      *  This is an expensive operation, and you are responsible for deleting
  73.      *  the returned object yourself.
  74.      */
  75.     KSSLCertChain *replicate();
  76.  
  77.     /**
  78.      *  Set the raw chain from OpenSSL
  79.      *  @internal
  80.      */
  81.     void setChain(void *stack_of_x509);
  82.  
  83.     /**
  84.      *  Set the certificate chain as a pointer list of KSSL certificates.
  85.      *
  86.      *  @param chain the certificate chain
  87.      *  @see KSSLCertificate
  88.      */
  89.     void setChain(QPtrList<KSSLCertificate>& chain);
  90.  
  91.     /**
  92.      *  Set the certificate chain as a list of base64 encoded X.509
  93.      *  certificates.
  94.      *
  95.      *  @param chain the certificate chain
  96.      *  @deprecated
  97.      */
  98.     void setChain(QStringList chain) KDE_DEPRECATED;
  99.  
  100.     /**
  101.      *  Set the certificate chain as a list of base64 encoded X.509
  102.      *  certificates.
  103.      *
  104.      *  @param chain the certificate chain
  105.      */
  106.     void setCertChain(const QStringList& chain);
  107.  
  108.     /**
  109.      *  Obtain a copy of the certificate chain.
  110.      *
  111.      *  @return a deep copy of the certificate chain.
  112.      *  @see KSSLCertificate
  113.      */
  114.     QPtrList<KSSLCertificate> getChain();
  115.  
  116.     /**
  117.      *  Determine the number of entries (depth) of the chain.
  118.      *
  119.      *  @return the number of entries in the certificate chain
  120.      */
  121.     int depth();
  122.  
  123.     /**
  124.      *  Read the raw chain in OpenSSL format
  125.      *  @internal
  126.      */
  127.     void *rawChain() { return _chain; }
  128.  
  129. private:
  130.     KSSLCertChainPrivate *d;
  131.     void *_chain;
  132. };
  133.  
  134.  
  135. #endif
  136.  
  137.