kio Library API Documentation

ksslpkcs12.h

00001 /* This file is part of the KDE project
00002  *
00003  * Copyright (C) 2001 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 _KSSLPKCS12_H
00022 #define _KSSLPKCS12_H
00023 
00024 #include "ksslconfig.h"
00025 
00026 #ifdef KSSL_HAVE_SSL
00027 #define crypt _openssl_crypt
00028 #include <openssl/pkcs12.h>
00029 #undef crypt
00030 #else
00031 class PKCS12;
00032 class EVP_PKEY;
00033 class X509;
00034 #endif
00035 
00036 #include <ksslcertificate.h>
00037 #include <ksslcertchain.h>
00038 
00039 #ifndef STACK_OF
00040 #define STACK_OF(x) void
00041 #endif
00042 
00043 class KSSL;
00044 class KSSLPKCS12Private;
00045 class KOpenSSLProxy;
00046 
00057 class KSSLPKCS12 {
00058 friend class KSSL;
00059 
00060 public:
00064     virtual ~KSSLPKCS12();
00065 
00071     QString name();
00072 
00079     static KSSLPKCS12* fromString(QString base64, QString password = "");
00080 
00087     static KSSLPKCS12* loadCertFile(QString filename, QString password = "");
00088 
00093     QString toString();
00094 
00100     void setCert(PKCS12 *c);
00101 
00108     bool changePassword(QString pold, QString pnew);
00109  
00115     EVP_PKEY *getPrivateKey();
00116 
00121     KSSLCertificate *getCertificate();
00122 
00128     bool toFile(QString filename);
00129 
00135     KSSLCertificate::KSSLValidation validate();
00136 
00143     KSSLCertificate::KSSLValidation validate(KSSLCertificate::KSSLPurpose p);
00144 
00151     KSSLCertificate::KSSLValidation revalidate();
00152 
00160     KSSLCertificate::KSSLValidation revalidate(KSSLCertificate::KSSLPurpose p);
00161 
00166     bool isValid();
00167 
00173     bool isValid(KSSLCertificate::KSSLPurpose p);
00174 
00175 protected:
00176     KSSLPKCS12();
00177     bool parse(QString pass);
00178 
00179 private:
00180     KSSLPKCS12Private *d;
00181     PKCS12 *_pkcs;
00182     KOpenSSLProxy *kossl;
00183     EVP_PKEY *_pkey;
00184     KSSLCertificate *_cert;
00185     STACK_OF(X509) *_caStack;
00186 };
00187 
00188 
00189 #endif
00190 
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 Wed May 5 07:16:50 2004 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003