ksslpkcs12.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _KSSLPKCS12_H
00025 #define _KSSLPKCS12_H
00026
00027 #include "ksslconfig.h"
00028
00029 #ifdef KSSL_HAVE_SSL
00030 #define crypt _openssl_crypt
00031 #include <openssl/pkcs12.h>
00032 #undef crypt
00033 #else
00034 class PKCS12;
00035 class EVP_PKEY;
00036 class X509;
00037 #endif
00038
00039
00040 #include <ksslcertificate.h>
00041 #include <ksslcertchain.h>
00042
00043 #ifndef STACK_OF
00044 #define STACK_OF(x) void
00045 #endif
00046
00047 class KSSL;
00048 class KSSLPKCS12Private;
00049 class KOpenSSLProxy;
00050
00051
00052 class KSSLPKCS12 {
00053 friend class KSSL;
00054
00055 public:
00056 virtual ~KSSLPKCS12();
00057
00058
00059
00060
00061
00062 QString name();
00063
00064
00065
00066
00067
00068 static KSSLPKCS12* fromString(QString base64, QString password = "");
00069
00070
00071
00072
00073
00074 static KSSLPKCS12* loadCertFile(QString filename, QString password = "");
00075
00076
00077
00078
00079 QString toString();
00080
00081
00082
00083
00084 void setCert(PKCS12 *c);
00085
00086
00087
00088
00089 bool changePassword(QString pold, QString pnew);
00090
00091
00092
00093
00094
00095 EVP_PKEY *getPrivateKey();
00096
00097
00098
00099
00100
00101 KSSLCertificate *getCertificate();
00102
00103
00104
00105
00106
00107 bool toFile(QString filename);
00108
00109
00110
00111
00112
00113 KSSLCertificate::KSSLValidation validate();
00114 KSSLCertificate::KSSLValidation validate(KSSLCertificate::KSSLPurpose p);
00115
00116
00117
00118
00119
00120
00121 KSSLCertificate::KSSLValidation revalidate();
00122 KSSLCertificate::KSSLValidation revalidate(KSSLCertificate::KSSLPurpose p);
00123
00124
00125
00126
00127
00128 bool isValid();
00129 bool isValid(KSSLCertificate::KSSLPurpose p);
00130
00131
00132
00133 protected:
00134 KSSLPKCS12();
00135
00136
00137
00138
00139 bool parse(QString pass);
00140
00141 private:
00142 KSSLPKCS12Private *d;
00143 PKCS12 *_pkcs;
00144 KOpenSSLProxy *kossl;
00145 EVP_PKEY *_pkey;
00146 KSSLCertificate *_cert;
00147 STACK_OF(X509) *_caStack;
00148 };
00149
00150
00151 #endif
00152
This file is part of the documentation for kdelibs Version 3.1.0.