tdeio/kssl
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 <tqcstring.h>
00026 #include <tqptrlist.h>
00027 #include "ksslpkcs12.h"
00028 #include "ksslcertificate.h"
00029
00030 class KOpenSSLProxy;
00031 class KSMIMECryptoPrivate;
00032
00033 class TDEIO_EXPORT 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 TQCString &clearText,
00064 TQByteArray &cipherText,
00065 const KSSLPKCS12 &privKey,
00066 const TQPtrList<KSSLCertificate> &certs,
00067 bool detached);
00068
00078 rc checkDetachedSignature(const TQCString &clearText,
00079 const TQByteArray &signature,
00080 TQPtrList<KSSLCertificate> &foundCerts);
00081
00091 rc checkOpaqueSignature(const TQByteArray &signedText,
00092 TQCString &clearText,
00093 TQPtrList<KSSLCertificate> &foundCerts);
00094
00107 rc encryptMessage(const TQCString &clearText,
00108 TQByteArray &cipherText,
00109 algo algorithm,
00110 const TQPtrList<KSSLCertificate> &recip);
00111
00119 rc decryptMessage(const TQByteArray &cipherText,
00120 TQCString &clearText,
00121 const KSSLPKCS12 &privKey);
00122
00123 private:
00124 KSMIMECryptoPrivate *priv;
00125 KOpenSSLProxy *kossl;
00126 };
00127
00128 #endif