kio Library API Documentation

ksslcertificatehome.h

00001 /* This file is part of the KDE project
00002  *
00003  * Copyright (C) 2000-2003 George Staikos <staikos@kde.org>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public License
00016  * along with this library; see the file COPYING.LIB.  If not, write to
00017  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018  * Boston, MA 02111-1307, USA.
00019  */ 
00020 
00021 #ifndef _KSSLCERTIFICATEHOME_H
00022 #define _KSSLCERTIFICATEHOME_H
00023 
00024 class KSSLCertificate;
00025 class KSSLPKCS12;
00026 #include <qstring.h>
00027 #include <qstringlist.h>
00028 
00029 
00030 class KSSLCertificateHome {
00031  
00032 public:
00033 
00034     // AuthNone means there is no policy.  AuthDont means _don't_ _send_!!
00035     enum KSSLAuthAction {AuthNone, AuthSend, AuthPrompt, AuthDont};
00036     /*
00037      *  These methods might dynamically allocate an object for you.  Be sure
00038      *  to delete them when you are done.
00039      */
00040     static KSSLPKCS12* getCertificateByHost(QString host, QString password, KSSLAuthAction* aa);
00041     static KSSLPKCS12* getCertificateByName(QString name, QString password);
00042     static KSSLPKCS12* getCertificateByName(QString name);
00043     static QString getDefaultCertificateName(QString host, KSSLAuthAction *aa = NULL);
00044     static QString getDefaultCertificateName(KSSLAuthAction *aa = NULL);
00045     static KSSLPKCS12* getDefaultCertificate(QString password, KSSLAuthAction *aa = NULL);
00046     static KSSLPKCS12* getDefaultCertificate(KSSLAuthAction *aa = NULL);
00047     static bool hasCertificateByName(QString name);
00048 
00049 
00050     /*
00051      *   These set the default certificate for hosts without a policy.
00052      */
00053     static void setDefaultCertificate(QString name, bool send = true, bool prompt = false);
00054     static void setDefaultCertificate(KSSLPKCS12 *cert, bool send = true, bool prompt = false);
00055 
00056 
00057     /*
00058      *   These set the default certificate for a host.
00059      */
00060     static void setDefaultCertificate(QString name, QString host, bool send = true, bool prompt = false);
00061     static void setDefaultCertificate(KSSLPKCS12 *cert, QString host, bool send = true, bool prompt = false);
00062 
00063     /*
00064      *   These add a certificate to the repository.
00065      *   Returns: true on success, false error
00066      */
00067     static bool addCertificate(QString filename, QString password, bool storePass = false);
00068     static void addCertificate(KSSLPKCS12 *cert, QString passToStore = "");
00069  
00070     /*
00071      *   Returns the list of certificates available
00072      */
00073     static QStringList getCertificateList();
00074 
00075 private:
00076     class KSSLCertificateHomePrivate;
00077     KSSLCertificateHomePrivate *d;
00078 };
00079 
00080 #endif
00081 
KDE Logo
This file is part of the documentation for kio Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun May 16 22:03:22 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003