kio Library API Documentation

KSMIMECrypto Class Reference

List of all members.

Public Types

enum  algo {
  KSC_C_DES3_CBC = 1, KSC_C_RC2_CBC_128, KSC_C_RC2_CBC_64, KSC_C_DES_CBC,
  KSC_C_RC2_CBC_40
}
enum  rc {
  KSC_R_OK, KSC_R_OTHER, KSC_R_NO_SSL, KSC_R_NOCIPHER,
  KSC_R_NOMEM, KSC_R_FORMAT, KSC_R_WRONGKEY, KSC_R_VERIFY
}

Public Member Functions

 KSMIMECrypto ()
 ~KSMIMECrypto ()
rc signMessage (const QCString &clearText, QByteArray &cipherText, const KSSLPKCS12 &privKey, const QPtrList< KSSLCertificate > &certs, bool detached)
rc checkDetachedSignature (const QCString &clearText, const QByteArray &signature, QPtrList< KSSLCertificate > &foundCerts)
rc checkOpaqueSignature (const QByteArray &signedText, QCString &clearText, QPtrList< KSSLCertificate > &foundCerts)
rc encryptMessage (const QCString &clearText, QByteArray &cipherText, algo algorithm, const QPtrList< KSSLCertificate > &recip)
rc decryptMessage (const QByteArray &cipherText, QCString &clearText, const KSSLPKCS12 &privKey)

Detailed Description

Definition at line 33 of file ksmimecrypto.h.


Member Function Documentation

KSMIMECrypto::rc KSMIMECrypto::signMessage const QCString clearText,
QByteArray cipherText,
const KSSLPKCS12 privKey,
const QPtrList< KSSLCertificate > &  certs,
bool  detached
 

Sign a message.

Parameters:
clearText MIME representation of the message (part) to sign
cipherText signature to append or signature block
privKey private key/certificate to sign with
certs additional certificates (may be empty)
detached create detached or opaque signature
Returns:
0 on success

Definition at line 306 of file ksmimecrypto.cc.

References KOpenSSLProxy::BIO_free(), KOpenSSLProxy::BIO_new(), KOpenSSLProxy::BIO_new_mem_buf(), and KOpenSSLProxy::BIO_s_mem().

KSMIMECrypto::rc KSMIMECrypto::checkDetachedSignature const QCString clearText,
const QByteArray signature,
QPtrList< KSSLCertificate > &  foundCerts
 

Check a detached message signature Will check if messages matches signature and extract certificates Does not check certificates for validity!

Parameters:
clearText MIME representation of signed message (without SIG)
signature signature
foundCerts certificates found in this message
Returns:
0 on success

Definition at line 333 of file ksmimecrypto.cc.

References KOpenSSLProxy::BIO_free(), KOpenSSLProxy::BIO_new_mem_buf(), and QCString::length().

KSMIMECrypto::rc KSMIMECrypto::checkOpaqueSignature const QByteArray signedText,
QCString clearText,
QPtrList< KSSLCertificate > &  foundCerts
 

Check an opaque signed message Will check if signature matches and extract message Does not check certificates for validity!

Parameters:
signedText signed message block
clearText cleartext of signed message certificates found in this mesasge
Returns:
0 on success

Definition at line 353 of file ksmimecrypto.cc.

References KOpenSSLProxy::BIO_free(), KOpenSSLProxy::BIO_new(), KOpenSSLProxy::BIO_new_mem_buf(), KOpenSSLProxy::BIO_s_mem(), and KOpenSSLProxy::BIO_write().

KSMIMECrypto::rc KSMIMECrypto::encryptMessage const QCString clearText,
QByteArray cipherText,
algo  algorithm,
const QPtrList< KSSLCertificate > &  recip
 

Encrypt a message encrypts a message for the given list of recipients and the selected algorithm.

Note that any algorithm <128 bytes is insecure and should never be used, even if SMIME-2 requires only RC2-40

Parameters:
clearText MIME representation of message to encrypt
cipherText returned encrypted message
algorithm encryption algorithm recipient certificates
Returns:
0 on success

Definition at line 377 of file ksmimecrypto.cc.

References KOpenSSLProxy::BIO_free(), KOpenSSLProxy::BIO_new(), KOpenSSLProxy::BIO_new_mem_buf(), and KOpenSSLProxy::BIO_s_mem().

KSMIMECrypto::rc KSMIMECrypto::decryptMessage const QByteArray cipherText,
QCString clearText,
const KSSLPKCS12 privKey
 

Decrypt a message.

Parameters:
cipherText encrypted message block
clearText returns decrypted message
privKey private key to use
Returns:
0 on success

Definition at line 402 of file ksmimecrypto.cc.

References KOpenSSLProxy::BIO_free(), KOpenSSLProxy::BIO_new(), KOpenSSLProxy::BIO_new_mem_buf(), KOpenSSLProxy::BIO_s_mem(), and KOpenSSLProxy::BIO_write().


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.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 8 06:23:42 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003