KIO
ksmimecrypto.h
Go to the documentation of this file.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 <QtCore/QList>
00026 #include "ksslpkcs12.h"
00027 #include "ksslcertificate.h"
00028
00029 class KOpenSSLProxy;
00030 class KSMIMECryptoPrivate;
00031
00032 class KIO_EXPORT KSMIMECrypto {
00033 public:
00034 KSMIMECrypto();
00035 ~KSMIMECrypto();
00036
00037 enum algo { KSC_C_DES3_CBC = 1,
00038 KSC_C_RC2_CBC_128,
00039 KSC_C_RC2_CBC_64,
00040 KSC_C_DES_CBC,
00041 KSC_C_RC2_CBC_40 };
00042
00043 enum rc { KSC_R_OK,
00044 KSC_R_OTHER,
00045 KSC_R_NO_SSL,
00046 KSC_R_NOCIPHER,
00047 KSC_R_NOMEM,
00048 KSC_R_FORMAT,
00049 KSC_R_WRONGKEY,
00050 KSC_R_VERIFY
00051 };
00052
00062 rc signMessage(const QByteArray &clearText,
00063 QByteArray &cipherText,
00064 const KSSLPKCS12 &privKey,
00065 const QList<KSSLCertificate *> &certs,
00066 bool detached);
00067
00077 rc checkDetachedSignature(const QByteArray &clearText,
00078 const QByteArray &signature,
00079 QList<KSSLCertificate *> &foundCerts);
00080
00090 rc checkOpaqueSignature(const QByteArray &signedText,
00091 QByteArray &clearText,
00092 QList<KSSLCertificate *> &foundCerts);
00093
00106 rc encryptMessage(const QByteArray &clearText,
00107 QByteArray &cipherText,
00108 algo algorithm,
00109 const QList<KSSLCertificate *> &recip);
00110
00118 rc decryptMessage(const QByteArray &cipherText,
00119 QByteArray &clearText,
00120 const KSSLPKCS12 &privKey);
00121
00122 private:
00123 KSMIMECryptoPrivate *priv;
00124 KOpenSSLProxy *kossl;
00125 };
00126
00127 #endif