kio Library API Documentation

KSSLPKCS12 Class Reference

KDE PKCS#12 Certificate KDE PKCS#12 Certificate. More...

#include <ksslpkcs12.h>

List of all members.

Public Member Functions

virtual ~KSSLPKCS12 ()
QString name ()
QString toString ()
void setCert (PKCS12 *c)
bool changePassword (QString pold, QString pnew)
EVP_PKEY * getPrivateKey ()
KSSLCertificategetCertificate ()
bool toFile (QString filename)
KSSLCertificate::KSSLValidation validate ()
KSSLCertificate::KSSLValidation validate (KSSLCertificate::KSSLPurpose p)
KSSLCertificate::KSSLValidation revalidate ()
KSSLCertificate::KSSLValidation revalidate (KSSLCertificate::KSSLPurpose p)
bool isValid ()
bool isValid (KSSLCertificate::KSSLPurpose p)

Static Public Member Functions

KSSLPKCS12fromString (QString base64, QString password="")
KSSLPKCS12loadCertFile (QString filename, QString password="")

Protected Member Functions

bool parse (QString pass)


Detailed Description

KDE PKCS#12 Certificate KDE PKCS#12 Certificate.

As of yet, this class is being defined. if you use it, let it be known that BC will break on you until this message is removed.

Author:
George Staikos <staikos@kde.org>
See also:
KSSL, KSSLCertificate

Definition at line 57 of file ksslpkcs12.h.


Constructor & Destructor Documentation

KSSLPKCS12::~KSSLPKCS12  )  [virtual]
 

Destroy this PKCS#12 certificate.

Definition at line 58 of file ksslpkcs12.cc.

References KOpenSSLProxy::EVP_PKEY_free(), KOpenSSLProxy::PKCS12_free(), and KOpenSSLProxy::X509_free().


Member Function Documentation

QString KSSLPKCS12::name  ) 
 

The name of this certificate.

This can be used to refer to the certificate instead of passing the object itself.

Returns:
the name of the certificate

Definition at line 279 of file ksslpkcs12.cc.

References KSSLCertificate::getSubject().

KSSLPKCS12 * KSSLPKCS12::fromString QString  base64,
QString  password = ""
[static]
 

Create a KSSLPKCS12 object from a Base64 in a QString.

Parameters:
base64 the base64 encoded certificate
password a password for the certificate if encrypted
Returns:
the PKCS#12 object, or NULL on failure.

Definition at line 75 of file ksslpkcs12.cc.

References KTempFile::close(), KTempFile::file(), fromString(), loadCertFile(), KTempFile::name(), and KTempFile::unlink().

Referenced by fromString().

KSSLPKCS12 * KSSLPKCS12::loadCertFile QString  filename,
QString  password = ""
[static]
 

Create a KSSLPKCS12 object by reading a PKCS#12 file.

Parameters:
filename the filename of the certificate
password a password for the certificate if encrypted
Returns:
the PKCS#12 object, or NULL on failure.

Definition at line 93 of file ksslpkcs12.cc.

References loadCertFile(), parse(), and setCert().

Referenced by fromString(), and loadCertFile().

QString KSSLPKCS12::toString  ) 
 

Convert to a Base64 string.

Returns:
the certificate in base64 form

Definition at line 196 of file ksslpkcs12.cc.

References KOpenSSLProxy::i2d_PKCS12().

void KSSLPKCS12::setCert PKCS12 *  c  ) 
 

Raw set the PKCS12 object.

Parameters:
c the openssl PKCS12 object

Definition at line 126 of file ksslpkcs12.cc.

References setCert().

Referenced by loadCertFile(), and setCert().

bool KSSLPKCS12::changePassword QString  pold,
QString  pnew
 

Change the password of the PKCS#12 in memory.

Parameters:
pold the old password
pnew the new password
Returns:
true on success

Definition at line 133 of file ksslpkcs12.cc.

References changePassword(), and KOpenSSLProxy::PKCS12_newpass().

Referenced by changePassword().

EVP_PKEY * KSSLPKCS12::getPrivateKey  ) 
 

Get the private key.

Returns:
the internal OpenSSL private key format

Definition at line 186 of file ksslpkcs12.cc.

Referenced by KSSL::setClientCertificate().

KSSLCertificate * KSSLPKCS12::getCertificate  ) 
 

Get the X.509 certificate.

Returns:
the X.509 certificate for the PKCS#12 object, or NULL

Definition at line 191 of file ksslpkcs12.cc.

Referenced by KSSL::setClientCertificate().

bool KSSLPKCS12::toFile QString  filename  ) 
 

Write the PKCS#12 to a file in raw mode.

Parameters:
filename the file to write to
Returns:
true on success

Definition at line 217 of file ksslpkcs12.cc.

References KOpenSSLProxy::i2d_PKCS12_fp(), and toFile().

Referenced by toFile().

KSSLCertificate::KSSLValidation KSSLPKCS12::validate  ) 
 

Check the X.509 and private key to make sure they're valid.

Returns:
the result of the validation
See also:
KSSLCertificate

Definition at line 240 of file ksslpkcs12.cc.

Referenced by isValid().

KSSLCertificate::KSSLValidation KSSLPKCS12::validate KSSLCertificate::KSSLPurpose  p  ) 
 

Check the X.509 and private key to make sure they're valid.

Parameters:
p the purpose to validate for
Returns:
the result of the validation
See also:
KSSLCertificate

Definition at line 245 of file ksslpkcs12.cc.

References KSSLCertificate::getCert(), KSSLCertificate::validate(), and KOpenSSLProxy::X509_check_private_key().

KSSLCertificate::KSSLValidation KSSLPKCS12::revalidate  ) 
 

Check the X.509 and private key to make sure they're valid.

Ignore any cached validation result.

Returns:
the result of the validation
See also:
KSSLCertificate

Definition at line 259 of file ksslpkcs12.cc.

KSSLCertificate::KSSLValidation KSSLPKCS12::revalidate KSSLCertificate::KSSLPurpose  p  ) 
 

Check the X.509 and private key to make sure they're valid.

Ignore any cached validation result.

Parameters:
p the purpose to validate for
Returns:
the result of the validation
See also:
KSSLCertificate

Definition at line 264 of file ksslpkcs12.cc.

References KSSLCertificate::revalidate().

bool KSSLPKCS12::isValid  ) 
 

Check if the X.509 and private key are valid.

Returns:
true if valid

Definition at line 269 of file ksslpkcs12.cc.

bool KSSLPKCS12::isValid KSSLCertificate::KSSLPurpose  p  ) 
 

Check if the X.509 and private key are valid.

Parameters:
p the purpose to validate for
Returns:
true if valid

Definition at line 274 of file ksslpkcs12.cc.

References validate().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kio Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 10 18:55:32 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003