# kio Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KSSLPKCS12 Class Reference

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

`#include <ksslpkcs12.h>`

Collaboration diagram for KSSLPKCS12:

[legend]
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 ()
KSSLCertificate * | getCertificate ()
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

static KSSLPKCS12 * | fromString (QString base64, QString password="")
static KSSLPKCS12 * | loadCertFile (QString filename, QString password="")

## Protected Member Functions

bool | parse (QString pass)

## Friends

class | KSSL

## 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 61 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.

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 KCodecs::base64Decode(), KTempFile::close(), KTempFile::file(), QString::isEmpty(), QString::latin1(), loadCertFile(), KTempFile::name(), and KTempFile::unlink().

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 QFile::handle(), QFile::open(), parse(), and setCert().

Referenced by fromString().

QString KSSLPKCS12::toString | ( |  | ) |

Convert to a Base64 string.

Returns:
  the certificate in base64 form

Definition at line 196 of file ksslpkcs12.cc.

References KCodecs::base64Encode(), and 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.

Referenced by loadCertFile().

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 QString::isNull(), QString::latin1(), and KOpenSSLProxy::PKCS12_newpass().

EVP_PKEY * KSSLPKCS12::getPrivateKey | ( |  | ) |

Get the private key.

Returns:
  the internal OpenSSL private key format

Definition at line 186 of file ksslpkcs12.cc.

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.

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 QFile::handle(), KOpenSSLProxy::i2d_PKCS12_fp(), QString::latin1(), and QFile::open().

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 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.

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:

- ksslpkcs12.h
- ksslpkcs12.cc

This file is part of the documentation for kio Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:25:26 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003