.TH "KSSLCertificate" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KSSLCertificate \- \fBKDE\fP X.509 Certificate \fBKDE\fP X.509 Certificate.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <ksslcertificate.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "typedef \fBQValueList\fP< \fBKSSLValidation\fP > \fBKSSLValidationList\fP"
.br
.ti -1c
.RI "enum \fBKSSLValidation\fP { \fBUnknown\fP, \fBOk\fP, \fBNoCARoot\fP, \fBInvalidPurpose\fP, \fBPathLengthExceeded\fP, \fBInvalidCA\fP, \fBExpired\fP, \fBSelfSigned\fP, \fBErrorReadingRoot\fP, \fBNoSSL\fP, \fBRevoked\fP, \fBUntrusted\fP, \fBSignatureFailed\fP, \fBRejected\fP, \fBPrivateKeyFailed\fP, \fBInvalidHost\fP, \fBIrrelevant\fP, \fBSelfSignedChain\fP }"
.br
.ti -1c
.RI "enum \fBKSSLPurpose\fP { \fBNone\fP = 0, \fBSSLServer\fP = 1, \fBSSLClient\fP = 2, \fBSMIMESign\fP = 3, \fBSMIMEEncrypt\fP = 4, \fBAny\fP = 5 }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fB~KSSLCertificate\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBtoString\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBgetSubject\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBgetIssuer\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBgetNotBefore\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBgetNotAfter\fP () const "
.br
.ti -1c
.RI "\fBQDateTime\fP \fBgetQDTNotBefore\fP () const "
.br
.ti -1c
.RI "\fBQDateTime\fP \fBgetQDTNotAfter\fP () const "
.br
.ti -1c
.RI "\fBQByteArray\fP \fBtoDer\fP ()"
.br
.ti -1c
.RI "\fBQByteArray\fP \fBtoPem\fP ()"
.br
.ti -1c
.RI "\fBQByteArray\fP \fBtoNetscape\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBtoText\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBgetSerialNumber\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBgetKeyType\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBgetPublicKeyText\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBgetMD5DigestText\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBgetMD5Digest\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBgetSignatureText\fP () const "
.br
.ti -1c
.RI "bool \fBisValid\fP ()"
.br
.ti -1c
.RI "bool \fBisValid\fP (KSSLPurpose p)"
.br
.ti -1c
.RI "\fBQStringList\fP \fBsubjAltNames\fP () const "
.br
.ti -1c
.RI "\fBKSSLValidation\fP \fBvalidate\fP ()"
.br
.ti -1c
.RI "\fBKSSLValidation\fP \fBvalidate\fP (KSSLPurpose p)"
.br
.ti -1c
.RI "\fBKSSLValidationList\fP \fBvalidateVerbose\fP (KSSLPurpose p)"
.br
.ti -1c
.RI "\fBKSSLValidationList\fP \fBvalidateVerbose\fP (KSSLPurpose p, \fBKSSLCertificate\fP *ca)"
.br
.ti -1c
.RI "\fBKSSLValidation\fP \fBrevalidate\fP ()"
.br
.ti -1c
.RI "\fBKSSLValidation\fP \fBrevalidate\fP (KSSLPurpose p)"
.br
.ti -1c
.RI "\fBKSSLCertChain\fP & \fBchain\fP ()"
.br
.ti -1c
.RI "\fBKSSLCertificate\fP * \fBreplicate\fP ()"
.br
.ti -1c
.RI "\fBKSSLCertificate\fP (const \fBKSSLCertificate\fP &x)"
.br
.ti -1c
.RI "bool \fBsetCert\fP (\fBQString\fP &cert)"
.br
.ti -1c
.RI "\fBKSSLX509V3\fP & \fBx509V3Extensions\fP ()"
.br
.ti -1c
.RI "bool \fBisSigner\fP ()"
.br
.ti -1c
.RI "void \fBgetEmails\fP (\fBQStringList\fP &to) const "
.br
.ti -1c
.RI "\fBQString\fP \fBgetKDEKey\fP () const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBKSSLCertificate\fP * \fBfromString\fP (\fBQCString\fP cert)"
.br
.ti -1c
.RI "static \fBKSSLCertificate\fP * \fBfromX509\fP (X509 *x5)"
.br
.ti -1c
.RI "static \fBQString\fP \fBverifyText\fP (\fBKSSLValidation\fP x)"
.br
.ti -1c
.RI "static \fBQString\fP \fBgetMD5DigestFromKDEKey\fP (const \fBQString\fP &k)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBsetCert\fP (X509 *c)"
.br
.ti -1c
.RI "void \fBsetChain\fP (void *c)"
.br
.ti -1c
.RI "X509 * \fBgetCert\fP ()"
.br
.ti -1c
.RI "\fBKSSLValidation\fP \fBprocessError\fP (int ec)"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKSSL\fP"
.br
.ti -1c
.RI "class \fBKSSLCertificateHome\fP"
.br
.ti -1c
.RI "class \fBKSSLCertificateFactory\fP"
.br
.ti -1c
.RI "class \fBKSSLCertificateCache\fP"
.br
.ti -1c
.RI "class \fBKSSLCertChain\fP"
.br
.ti -1c
.RI "class \fBKSSLPeerInfo\fP"
.br
.ti -1c
.RI "class \fBKSSLPKCS12\fP"
.br
.ti -1c
.RI "class \fBKSSLD\fP"
.br
.ti -1c
.RI "class \fBKSMIMECryptoPrivate\fP"
.br
.ti -1c
.RI "KIO_EXPORT friend int \fBoperator!=\fP (\fBKSSLCertificate\fP &x, \fBKSSLCertificate\fP &y)"
.br
.ti -1c
.RI "KIO_EXPORT friend int \fBoperator==\fP (\fBKSSLCertificate\fP &x, \fBKSSLCertificate\fP &y)"
.br
.in -1c
.SH "Detailed Description"
.PP 
\fBKDE\fP X.509 Certificate \fBKDE\fP X.509 Certificate. 

This class represents an X.509 (SSL) certificate. Note: this object is VERY HEAVY TO COPY. Please try to use reference or pointer whenever possible
.PP
\fBAuthor:\fP
.RS 4
George Staikos <staikos@kde.org> 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKSSL\fP 
.RE
.PP

.PP
Definition at line 75 of file ksslcertificate.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKSSLCertificate::KSSLValidation\fP"
.PP
A CA certificate can be validated as Irrelevant when it was not used to sign any other relevant certificate. 
.PP
Definition at line 113 of file ksslcertificate.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KSSLCertificate::~\fBKSSLCertificate\fP ()"
.PP
Destroy this X.509 certificate. 
.PP

.PP
Definition at line 118 of file ksslcertificate.cc.
.SS "KSSLCertificate::KSSLCertificate (const \fBKSSLCertificate\fP & x)"
.PP
Copy constructor. 
.PP
Beware, this is very expensive. 
.PP
\fBParameters:\fP
.RS 4
\fIx\fP the object to copy from
.RE
.PP

.PP
Definition at line 103 of file ksslcertificate.cc.
.PP
References KStandardDirs::addResourceType(), KGlobal::dirs(), KSSLCertChain::rawChain(), and setCert().
.PP
Referenced by replicate().
.SH "Member Function Documentation"
.PP 
.SS "\fBKSSLCertificate\fP * KSSLCertificate::fromString (\fBQCString\fP cert)\fC [static]\fP"
.PP
Create an X.509 certificate from a base64 encoded string. 
.PP
\fBParameters:\fP
.RS 4
\fIcert\fP the certificate in base64 form 
.RE
.PP
\fBReturns:\fP
.RS 4
the X.509 certificate, or NULL
.RE
.PP

.PP
Definition at line 144 of file ksslcertificate.cc.
.PP
References KCodecs::base64Decode(), QCString::copy(), QCString::length(), and setCert().
.PP
Referenced by Observer::messageBox(), and KSSLCertChain::setCertChain().
.SS "\fBKSSLCertificate\fP * KSSLCertificate::fromX509 (X509 * x5)\fC [static]\fP"
.PP
Create an X.509 certificate from the internal representation. 
.PP
This one duplicates the X509 object for itself. 
.PP
\fBParameters:\fP
.RS 4
\fIx5\fP the OpenSSL representation of the certificate 
.RE
.PP
\fBReturns:\fP
.RS 4
the X.509 certificate, or NULL 
.RE
.PP

.PP
Definition at line 132 of file ksslcertificate.cc.
.PP
References setCert().
.SS "\fBQString\fP KSSLCertificate::toString ()"
.PP
Convert this certificate to a string. 
.PP
\fBReturns:\fP
.RS 4
the certificate in base64 format
.RE
.PP

.PP
Definition at line 912 of file ksslcertificate.cc.
.PP
References KCodecs::base64Encode(), and toDer().
.PP
Referenced by toPem().
.SS "\fBQString\fP KSSLCertificate::getSubject () const"
.PP
Get the subject of the certificate (X.509 map). 
.PP
\fBReturns:\fP
.RS 4
the subject
.RE
.PP

.PP
Definition at line 166 of file ksslcertificate.cc.
.PP
Referenced by KSSLPeerInfo::certMatchesAddress(), getKDEKey(), and KSSLPKCS7::name().
.SS "\fBQString\fP KSSLCertificate::getIssuer () const"
.PP
Get the issuer of the certificate (X.509 map). 
.PP
\fBReturns:\fP
.RS 4
the issuer
.RE
.PP

.PP
Definition at line 425 of file ksslcertificate.cc.
.SS "\fBQString\fP KSSLCertificate::getNotBefore () const"
.PP
Get the date that the certificate becomes valid on. 
.PP
\fBReturns:\fP
.RS 4
the date as a string, localised
.RE
.PP

.PP
Definition at line 852 of file ksslcertificate.cc.
.SS "\fBQString\fP KSSLCertificate::getNotAfter () const"
.PP
Get the date that the certificate is valid until. 
.PP
\fBReturns:\fP
.RS 4
the date as a string, localised
.RE
.PP

.PP
Definition at line 861 of file ksslcertificate.cc.
.SS "\fBQDateTime\fP KSSLCertificate::getQDTNotBefore () const"
.PP
Get the date that the certificate becomes valid on. 
.PP
\fBReturns:\fP
.RS 4
the date
.RE
.PP

.PP
Definition at line 870 of file ksslcertificate.cc.
.PP
References QDateTime::currentDateTime().
.SS "\fBQDateTime\fP KSSLCertificate::getQDTNotAfter () const"
.PP
Get the date that the certificate is valid until. 
.PP
\fBReturns:\fP
.RS 4
the date
.RE
.PP

.PP
Definition at line 879 of file ksslcertificate.cc.
.PP
References QDateTime::currentDateTime().
.SS "\fBQByteArray\fP KSSLCertificate::toDer ()"
.PP
Convert the certificate to DER (ASN.1) format. 
.PP
\fBReturns:\fP
.RS 4
the binary data of the DER encoding
.RE
.PP

.PP
Definition at line 957 of file ksslcertificate.cc.
.PP
Referenced by toString().
.SS "\fBQByteArray\fP KSSLCertificate::toPem ()"
.PP
Convert the certificate to PEM (base64) format. 
.PP
\fBReturns:\fP
.RS 4
the binary data of the PEM encoding
.RE
.PP

.PP
Definition at line 977 of file ksslcertificate.cc.
.PP
References QString::append(), QString::insert(), QString::length(), QString::local8Bit(), QString::prepend(), and toString().
.SS "\fBQByteArray\fP KSSLCertificate::toNetscape ()"
.PP
Convert the certificate to Netscape format. 
.PP
\fBReturns:\fP
.RS 4
the binary data of the Netscape encoding
.RE
.PP

.PP
Definition at line 1005 of file ksslcertificate.cc.
.PP
References KTempFile::close(), KTempFile::fstream(), KTempFile::name(), and KTempFile::unlink().
.SS "\fBQString\fP KSSLCertificate::toText ()"
.PP
Convert the certificate to OpenSSL plain text format. 
.PP
\fBReturns:\fP
.RS 4
the OpenSSL text encoding
.RE
.PP

.PP
Definition at line 1038 of file ksslcertificate.cc.
.PP
References KTempFile::close(), KTempFile::fstream(), KTempFile::name(), and KTempFile::unlink().
.SS "\fBQString\fP KSSLCertificate::getSerialNumber () const"
.PP
Get the serial number of the certificate. 
.PP
\fBReturns:\fP
.RS 4
the serial number as a string
.RE
.PP

.PP
Definition at line 180 of file ksslcertificate.cc.
.SS "\fBQString\fP KSSLCertificate::getKeyType () const"
.PP
Get the key type (RSA, DSA, etc). 
.PP
\fBReturns:\fP
.RS 4
the key type as a string
.RE
.PP

.PP
Definition at line 305 of file ksslcertificate.cc.
.SS "\fBQString\fP KSSLCertificate::getPublicKeyText () const"
.PP
Get the public key. 
.PP
\fBReturns:\fP
.RS 4
the public key as a hexidecimal string
.RE
.PP

.PP
Definition at line 331 of file ksslcertificate.cc.
.PP
References QString::arg().
.SS "\fBQString\fP KSSLCertificate::getMD5DigestText () const"
.PP
Get the MD5 digest of the certificate. 
.PP
Result is padded with : to separate bytes - it's a text version! 
.PP
\fBReturns:\fP
.RS 4
the MD5 digest in a hexidecimal string
.RE
.PP

.PP
Definition at line 257 of file ksslcertificate.cc.
.PP
References QString::append().
.PP
Referenced by getKDEKey().
.SS "\fBQString\fP KSSLCertificate::getMD5Digest () const"
.PP
Get the MD5 digest of the certificate. 
.PP
\fBReturns:\fP
.RS 4
the MD5 digest in a hexidecimal string
.RE
.PP

.PP
Definition at line 282 of file ksslcertificate.cc.
.PP
References QString::append().
.SS "\fBQString\fP KSSLCertificate::getSignatureText () const"
.PP
Get the signature. 
.PP
\fBReturns:\fP
.RS 4
the signature in text format
.RE
.PP

.PP
Definition at line 194 of file ksslcertificate.cc.
.PP
References QString::append(), and QString::length().
.SS "bool KSSLCertificate::isValid ()"
.PP
Check if this is a valid certificate. 
.PP
Will use cached data. 
.PP
\fBReturns:\fP
.RS 4
true if it is valid
.RE
.PP

.PP
Definition at line 565 of file ksslcertificate.cc.
.SS "bool KSSLCertificate::isValid (KSSLPurpose p)"
.PP
Check if this is a valid certificate. 
.PP
Will use cached data. 
.PP
\fBParameters:\fP
.RS 4
\fIp\fP the purpose to validate for 
.RE
.PP
\fBReturns:\fP
.RS 4
true if it is valid
.RE
.PP

.PP
Definition at line 560 of file ksslcertificate.cc.
.PP
References validate().
.SS "\fBQStringList\fP KSSLCertificate::subjAltNames () const"
.PP
The alternate subject name. 
.PP
\fBReturns:\fP
.RS 4
string list with subjectAltName
.RE
.PP

.PP
Definition at line 1085 of file ksslcertificate.cc.
.PP
References QString::isEmpty().
.PP
Referenced by KSSLPeerInfo::certMatchesAddress().
.SS "\fBKSSLCertificate::KSSLValidation\fP KSSLCertificate::validate ()"
.PP
Check if this is a valid certificate. 
.PP
Will use cached data. 
.PP
\fBReturns:\fP
.RS 4
the result of the validation
.RE
.PP

.PP
Definition at line 590 of file ksslcertificate.cc.
.PP
Referenced by isValid(), revalidate(), and KSSLPKCS7::validate().
.SS "\fBKSSLCertificate::KSSLValidation\fP KSSLCertificate::validate (KSSLPurpose p)"
.PP
Check if this is a valid certificate. 
.PP
Will use cached data. 
.PP
\fBParameters:\fP
.RS 4
\fIp\fP the purpose to validate for 
.RE
.PP
\fBReturns:\fP
.RS 4
the result of the validation
.RE
.PP

.PP
Definition at line 594 of file ksslcertificate.cc.
.PP
References QValueList::first(), QValueList::isEmpty(), and validateVerbose().
.SS "\fBKSSLCertificate::KSSLValidationList\fP KSSLCertificate::validateVerbose (KSSLPurpose p)"
.PP
Check if this is a valid certificate. 
.PP
Will use cached data. 
.PP
\fBParameters:\fP
.RS 4
\fIp\fP the purpose to validate for 
.RE
.PP
\fBReturns:\fP
.RS 4
all problems encountered during validation
.RE
.PP

.PP
Definition at line 608 of file ksslcertificate.cc.
.PP
Referenced by validate().
.SS "\fBKSSLCertificate::KSSLValidationList\fP KSSLCertificate::validateVerbose (KSSLPurpose p, \fBKSSLCertificate\fP * ca)"
.PP
Check if the certificate ca is a proper CA for this certificate. 
.PP
\fBParameters:\fP
.RS 4
\fIp\fP the purpose to validate for 
.RE
.PP
\fBReturns:\fP
.RS 4
all problems encountered during validation
.RE
.PP

.PP
Definition at line 613 of file ksslcertificate.cc.
.PP
References KGlobal::dirs(), endl(), kdDebug(), and KStandardDirs::resourceDirs().
.SS "\fBKSSLCertificate::KSSLValidation\fP KSSLCertificate::revalidate ()"
.PP
Check if this is a valid certificate. 
.PP
Will NOT use cached data. 
.PP
\fBReturns:\fP
.RS 4
the result of the validation
.RE
.PP

.PP
Definition at line 753 of file ksslcertificate.cc.
.PP
Referenced by KSSLPKCS7::revalidate().
.SS "\fBKSSLCertificate::KSSLValidation\fP KSSLCertificate::revalidate (KSSLPurpose p)"
.PP
Check if this is a valid certificate. 
.PP
Will NOT use cached data. 
.PP
\fBParameters:\fP
.RS 4
\fIp\fP the purpose to validate for 
.RE
.PP
\fBReturns:\fP
.RS 4
the result of the validation
.RE
.PP

.PP
Definition at line 758 of file ksslcertificate.cc.
.PP
References validate().
.SS "\fBKSSLCertChain\fP & KSSLCertificate::chain ()"
.PP
Get a reference to the certificate chain. 
.PP
\fBReturns:\fP
.RS 4
reference to the chain
.RE
.PP

.PP
Definition at line 127 of file ksslcertificate.cc.
.PP
References KSSLCertChain::_chain.
.PP
Referenced by Observer::messageBox().
.SS "\fBQString\fP KSSLCertificate::verifyText (\fBKSSLValidation\fP x)\fC [static]\fP"
.PP
Obtain the localized message that corresponds to a validation result. 
.PP
\fBParameters:\fP
.RS 4
\fIx\fP the code to look up 
.RE
.PP
\fBReturns:\fP
.RS 4
the message text corresponding to the validation code
.RE
.PP

.PP
Definition at line 917 of file ksslcertificate.cc.
.SS "\fBKSSLCertificate\fP * KSSLCertificate::replicate ()"
.PP
Explicitly make a copy of this certificate. 
.PP
\fBReturns:\fP
.RS 4
a copy of the certificate
.RE
.PP

.PP
Definition at line 898 of file ksslcertificate.cc.
.PP
References KSSLCertificate(), KSSLCertChain::rawChain(), setCert(), and setChain().
.SS "bool KSSLCertificate::setCert (\fBQString\fP & cert)"
.PP
Re-set the certificate from a base64 string. 
.PP
\fBParameters:\fP
.RS 4
\fIcert\fP the certificate to set to 
.RE
.PP
\fBReturns:\fP
.RS 4
true on success
.RE
.PP

.PP
Definition at line 1060 of file ksslcertificate.cc.
.PP
References KCodecs::base64Decode(), and QString::local8Bit().
.PP
Referenced by fromString(), fromX509(), KSSLCertChain::getChain(), KSSLCertificate(), and replicate().
.SS "\fBKSSLX509V3\fP & KSSLCertificate::x509V3Extensions ()"
.PP
Access the X.509v3 parameters. 
.PP
\fBReturns:\fP
.RS 4
reference to the extension object 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKSSLX509V3\fP
.RE
.PP

.PP
Definition at line 1075 of file ksslcertificate.cc.
.SS "bool KSSLCertificate::isSigner ()"
.PP
Check if this is a signer certificate. 
.PP
\fBReturns:\fP
.RS 4
true if this is a signer certificate
.RE
.PP

.PP
Definition at line 1080 of file ksslcertificate.cc.
.PP
References KSSLX509V3::certTypeCA().
.SS "void KSSLCertificate::getEmails (\fBQStringList\fP & to) const"
.PP
FIXME: document. 
.PP
Definition at line 222 of file ksslcertificate.cc.
.PP
References QString::append().
.SS "\fBQString\fP KSSLCertificate::getKDEKey () const"
.PP
KDEKey is a concatenation 'Subject (MD5)', mostly needed for SMIME. 
.PP
The result of getKDEKey might change and should not be used for persistant storage.
.PP
Definition at line 239 of file ksslcertificate.cc.
.PP
References getMD5DigestText(), and getSubject().
.SS "\fBQString\fP KSSLCertificate::getMD5DigestFromKDEKey (const \fBQString\fP & k)\fC [static]\fP"
.PP
Aegypten semantics force us to search by MD5Digest only. 
.PP

.PP
Definition at line 244 of file ksslcertificate.cc.
.PP
References QString::findRev(), QString::length(), and QString::mid().

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
