# kio Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# ksmimecrypto.h

    00001 /* This file is part of the KDE project
    00002  *
    00003  * Copyright (C) 2003 Stefan Rompf <sux@loplof.de>
    00004  *
    00005  * This library is free software; you can redistribute it and/or
    00006  * modify it under the terms of the GNU Library General Public
    00007  * License as published by the Free Software Foundation; either
    00008  * version 2 of the License, or (at your option) any later version.
    00009  *
    00010  * This library is distributed in the hope that it will be useful,
    00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013  * Library General Public License for more details.
    00014  *
    00015  * You should have received a copy of the GNU Library General Public License
    00016  * along with this library; see the file COPYING.LIB.  If not, write to
    00017  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00018  * Boston, MA 02111-1307, USA.
    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 KIO_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,        /* everything ok */
    00045           KSC_R_OTHER,     /* unspecified error */
    00046           KSC_R_NO_SSL,    /* No crypto lib / compiled without SSL */
    00047           KSC_R_NOCIPHER,  /* encryption cipher n/a */
    00048           KSC_R_NOMEM,     /* out of memory */
    00049           KSC_R_FORMAT,    /* wrong input data format */
    00050           KSC_R_WRONGKEY,  /* wrong decryption/signature key */
    00051           KSC_R_VERIFY     /* data does not match signature */
    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.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:24:04 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003