ksmimecrypto.h
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 #ifndef __KSMIMECRYPTO_H
00022 #define __KSMIMECRYPTO_H
00023 
00024 
00025 #include <qcstring.h>
00026 #include <qptrlist.h>
00027 #include "ksslpkcs12.h"
00028 #include "ksslcertificate.h"
00029 
00030 class KOpenSSLProxy;
00031 class KSMIMECryptoPrivate;
00032 
00033 class KSMIMECrypto {
00034  public:
00035     KSMIMECrypto();
00036     ~KSMIMECrypto();
00037 
00038     enum algo { KSC_C_DES3_CBC = 1,
00039         KSC_C_RC2_CBC_128,
00040         KSC_C_RC2_CBC_64,
00041         KSC_C_DES_CBC,
00042         KSC_C_RC2_CBC_40 };
00043 
00044     enum rc { KSC_R_OK,        
00045           KSC_R_OTHER,     
00046           KSC_R_NO_SSL,    
00047           KSC_R_NOCIPHER,  
00048           KSC_R_NOMEM,     
00049           KSC_R_FORMAT,    
00050           KSC_R_WRONGKEY,  
00051           KSC_R_VERIFY     
00052     };
00053 
00063     rc signMessage(const QCString &clearText,
00064            QByteArray &cipherText,
00065            const KSSLPKCS12 &privKey,
00066            const QPtrList<KSSLCertificate> &certs,
00067            bool detached);
00068 
00078     rc checkDetachedSignature(const QCString &clearText,
00079                   const QByteArray &signature,
00080                   QPtrList<KSSLCertificate> &foundCerts);
00081 
00091     rc checkOpaqueSignature(const QByteArray &signedText,
00092                 QCString &clearText,
00093                 QPtrList<KSSLCertificate> &foundCerts);
00094     
00107     rc encryptMessage(const QCString &clearText,
00108               QByteArray &cipherText,
00109               algo algorithm,
00110               const QPtrList<KSSLCertificate> &recip);
00111 
00119     rc decryptMessage(const QByteArray &cipherText,
00120               QCString &clearText,
00121               const KSSLPKCS12 &privKey);
00122 
00123  private:
00124     KSMIMECryptoPrivate *priv;
00125     KOpenSSLProxy *kossl;
00126 };
00127 
00128 #endif
 
This file is part of the documentation for kio Library Version 3.2.0.