ksmimecrypto.h
/* This file is part of the KDE project
*
* Copyright (C) 2003 Stefan Rompf <sux@loplof.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __KSMIMECRYPTO_H
#define __KSMIMECRYPTO_H
#include <qcstring.h>
#include <qptrlist.h>
#include "ksslpkcs12.h"
#include "ksslcertificate.h"
class KOpenSSLProxy;
class KSMIMECryptoPrivate;
class KIO_EXPORT KSMIMECrypto {
public:
KSMIMECrypto();
~KSMIMECrypto();
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, /* everything ok */
KSC_R_OTHER, /* unspecified error */
KSC_R_NO_SSL, /* No crypto lib / compiled without SSL */
KSC_R_NOCIPHER, /* encryption cipher n/a */
KSC_R_NOMEM, /* out of memory */
KSC_R_FORMAT, /* wrong input data format */
KSC_R_WRONGKEY, /* wrong decryption/signature key */
KSC_R_VERIFY /* data does not match signature */
};
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);
private:
KSMIMECryptoPrivate *priv;
KOpenSSLProxy *kossl;
};
#endif
KOpenSSLProxy
Dynamically load and wrap OpenSSL.
Definition: kopenssl.h:63
KSSLPKCS12
KDE PKCS#12 Certificate.
Definition: ksslpkcs12.h:61

KDE Home | KDE Accessibility Home | Description of Access Keys