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 / ksslsigners.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  4.6 KB  |  173 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.  
  22. #ifndef _INCLUDE_KSSLSIGNERS_H
  23. #define _INCLUDE_KSSLSIGNERS_H
  24.  
  25. class KSSLCertificate;
  26. class DCOPClient;
  27.  
  28. #include <qstringlist.h>
  29.  
  30. #include <kdelibs_export.h>
  31.  
  32. // ### KDE4 - Fix constness
  33. /**
  34.  * KDE SSL Signer Database
  35.  *
  36.  * This class is used to manipulate the KDE SSL signer database.  It
  37.  * communicates to the KDE SSL daemon via dcop for backend integration.
  38.  *
  39.  * @author George Staikos <staikos@kde.org>
  40.  * @see KSSL, KSSLCertificate
  41.  * @short KDE SSL Signer Database
  42.  */
  43. class KIO_EXPORT KSSLSigners {
  44. public:
  45.     /**
  46.      *  Construct a KSSLSigner object.
  47.      */
  48.     KSSLSigners();
  49.  
  50.     /**
  51.      *  Destroy this KSSLSigner object.
  52.      */
  53.     ~KSSLSigners();
  54.  
  55.     /**
  56.      *  Add a signer to the database.
  57.      *
  58.      *  @param cert the signer's certificate
  59.      *  @param ssl allow it to sign for SSL
  60.      *  @param email allow it to sign for S/MIME
  61.      *  @param code allow it to sign for code signing
  62.      *  @return true on success
  63.      */
  64.     bool addCA(KSSLCertificate& cert, bool ssl, bool email, bool code);
  65.  
  66.     /**
  67.      *  Add a signer to the database.
  68.      *
  69.      *  @param cert the signer's certificate in base64 form
  70.      *  @param ssl allow it to sign for SSL
  71.      *  @param email allow it to sign for S/MIME
  72.      *  @param code allow it to sign for code signing
  73.      *  @return true on success
  74.      */
  75.     bool addCA(QString cert, bool ssl, bool email, bool code); 
  76.  
  77.     /**
  78.      *  Regenerate the signer-root file from the user's settings.
  79.      *  @return true on success
  80.      */
  81.     bool regenerate();
  82.  
  83.     /**
  84.      *  Determine if a certificate can be used for SSL certificate signing
  85.      *  @param cert the certificate
  86.      *  @return true if it can be used for SSL
  87.      */
  88.     bool useForSSL(KSSLCertificate& cert);
  89.  
  90.     /**
  91.      *  Determine if a certificate can be used for SSL certificate signing
  92.      *  @param subject the certificate subject
  93.      *  @return true if it can be used for SSL
  94.      */
  95.     bool useForSSL(QString subject);
  96.  
  97.     /**
  98.      *  Determine if a certificate can be used for S/MIME certificate signing
  99.      *  @param cert the certificate
  100.      *  @return true if it can be used for S/MIME
  101.      */
  102.     bool useForEmail(KSSLCertificate& cert);
  103.  
  104.     /**
  105.      *  Determine if a certificate can be used for S/MIME certificate signing
  106.      *  @param subject the certificate subject
  107.      *  @return true if it can be used for S/MIME
  108.      */
  109.     bool useForEmail(QString subject);
  110.  
  111.     /**
  112.      *  Determine if a certificate can be used for code certificate signing
  113.      *  @param cert the certificate
  114.      *  @return true if it can be used for code
  115.      */
  116.     bool useForCode(KSSLCertificate& cert);
  117.  
  118.     /**
  119.      *  Determine if a certificate can be used for code certificate signing
  120.      *  @param subject the certificate subject
  121.      *  @return true if it can be used for code
  122.      */
  123.     bool useForCode(QString subject);
  124.  
  125.     /**
  126.      *  Remove a certificate signer from the database
  127.      *  @param cert the certificate to remove
  128.      *  @return true on success
  129.      */
  130.     bool remove(KSSLCertificate& cert);
  131.  
  132.     /**
  133.      *  Remove a certificate signer from the database
  134.      *  @param subject the subject of the certificate to remove
  135.      *  @return true on success
  136.      */
  137.     bool remove(QString subject);
  138.  
  139.     /**
  140.      *  List the signers in the database.
  141.      *  @return the list of subjects in the database
  142.      *  @see getCert
  143.      */
  144.     QStringList list();
  145.  
  146.     /**
  147.      *  Get a signer certificate from the database.
  148.      *
  149.      *  @param subject the subject of the certificate desired
  150.      *  @return the base64 encoded certificate
  151.      */
  152.     QString getCert(QString subject);
  153.  
  154.     /**
  155.      *  Set the use of a particular entry in the certificate signer database.
  156.      *  @param subject the subject of the certificate in question
  157.      *  @param ssl allow this for SSL certificate signing
  158.      *  @param email allow this for S/MIME certificate signing
  159.      *  @param code allow this for code certificate signing
  160.      *  @return true on success
  161.      */
  162.     bool setUse(QString subject, bool ssl, bool email, bool code);
  163.  
  164. private:
  165.     class KSSLSignersPrivate;
  166.     KSSLSignersPrivate *d;
  167.  
  168.     DCOPClient *dcc;
  169. };
  170.  
  171.  
  172. #endif
  173.