• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kssl
ksslpkcs12.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 *
3 * Copyright (C) 2001 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 _KSSLPKCS12_H
22#define _KSSLPKCS12_H
23
24#include <ksslconfig.h>
25
26#ifdef KSSL_HAVE_SSL
27#define crypt _openssl_crypt
28#include <openssl/pkcs12.h>
29#undef crypt
30#else
31class PKCS12;
32class EVP_PKEY;
33#if !defined(QT_NO_OPENSSL)
34#include <QtNetwork/QSslCertificate>
35#else
36class X509;
37#endif
38#endif
39
40#include <ksslcertificate.h>
41#include <ksslcertchain.h>
42
43#include <QtCore/QString>
44
45#ifndef STACK_OF
46#define STACK_OF(x) void
47#endif
48
49class KSSL;
50class KSSLPKCS12Private;
51class KOpenSSLProxy;
52
63class KIO_EXPORT KSSLPKCS12 {
64friend class KSSL;
65
66public:
70 virtual ~KSSLPKCS12();
71
77 QString name() const;
78
85 static KSSLPKCS12* fromString(const QString &base64, const QString &password = QLatin1String(""));
86
93 static KSSLPKCS12* loadCertFile(const QString &filename, const QString &password = QLatin1String(""));
94
99 QString toString();
100
106 void setCert(PKCS12 *c);
107
114 bool changePassword(const QString &pold, const QString &pnew);
115
121 EVP_PKEY *getPrivateKey();
122
127 KSSLCertificate *getCertificate();
128
134 bool toFile(const QString &filename);
135
141 KSSLCertificate::KSSLValidation validate();
142
149 KSSLCertificate::KSSLValidation validate(KSSLCertificate::KSSLPurpose p);
150
157 KSSLCertificate::KSSLValidation revalidate();
158
166 KSSLCertificate::KSSLValidation revalidate(KSSLCertificate::KSSLPurpose p);
167
172 bool isValid();
173
179 bool isValid(KSSLCertificate::KSSLPurpose p);
180
181protected:
182 KSSLPKCS12();
183 bool parse(const QString &pass);
184
185private:
186 KSSLPKCS12Private *d;
187 PKCS12 *_pkcs;
188 KOpenSSLProxy *kossl;
189 EVP_PKEY *_pkey;
190 KSSLCertificate *_cert;
191 STACK_OF(X509) *_caStack;
192};
193
194
195#endif
196
KOpenSSLProxy
Dynamically load and wrap OpenSSL.
Definition kopenssl.h:65
KSSLCertificate
KDE X.509 Certificate.
Definition ksslcertificate.h:75
KSSLCertificate::KSSLValidation
KSSLValidation
Result of the validate() call.
Definition ksslcertificate.h:119
KSSLCertificate::KSSLPurpose
KSSLPurpose
Definition ksslcertificate.h:146
KSSLPKCS12::revalidate
KSSLCertificate::KSSLValidation revalidate()
Check the X.509 and private key to make sure they're valid.
Definition ksslpkcs12.cpp:258
KSSLPKCS12::parse
bool parse(const QString &pass)
Definition ksslpkcs12.cpp:143
KSSLPKCS12::KSSL
friend class KSSL
Definition ksslpkcs12.h:64
KSSLPKCS12::name
QString name() const
The name of this certificate.
Definition ksslpkcs12.cpp:278
KSSLPKCS12::getPrivateKey
EVP_PKEY * getPrivateKey()
Get the private key.
Definition ksslpkcs12.cpp:185
KSSLPKCS12::changePassword
bool changePassword(const QString &pold, const QString &pnew)
Change the password of the PKCS#12 in memory.
Definition ksslpkcs12.cpp:132
KSSLPKCS12::validate
KSSLCertificate::KSSLValidation validate()
Check the X.509 and private key to make sure they're valid.
Definition ksslpkcs12.cpp:239
KSSLPKCS12::getCertificate
KSSLCertificate * getCertificate()
Get the X.509 certificate.
Definition ksslpkcs12.cpp:190
KSSLPKCS12::fromString
static KSSLPKCS12 * fromString(const QString &base64, const QString &password=QLatin1String(""))
Create a KSSLPKCS12 object from a Base64 in a QString.
Definition ksslpkcs12.cpp:75
KSSLPKCS12::KSSLPKCS12
KSSLPKCS12()
Definition ksslpkcs12.cpp:48
KSSLPKCS12::toString
QString toString()
Convert to a Base64 string.
Definition ksslpkcs12.cpp:195
KSSLPKCS12::toFile
bool toFile(const QString &filename)
Write the PKCS#12 to a file in raw mode.
Definition ksslpkcs12.cpp:216
KSSLPKCS12::setCert
void setCert(PKCS12 *c)
Raw set the PKCS12 object.
Definition ksslpkcs12.cpp:125
KSSLPKCS12::loadCertFile
static KSSLPKCS12 * loadCertFile(const QString &filename, const QString &password=QLatin1String(""))
Create a KSSLPKCS12 object by reading a PKCS#12 file.
Definition ksslpkcs12.cpp:92
KSSLPKCS12::isValid
bool isValid()
Check if the X.509 and private key are valid.
Definition ksslpkcs12.cpp:268
KSSL
KDE SSL Wrapper Class.
Definition kssl.h:39
ksslcertchain.h
ksslcertificate.h
STACK_OF
#define STACK_OF(x)
Definition ksslpkcs12.h:46
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal