certmanager/lib

kpgpwrapper.cpp

00001 /*  -*- mode: C++; c-file-style: "gnu" -*-
00002     kpgpwrapper.cpp
00003 
00004     This file is part of libkleopatra, the KDE keymanagement library
00005     Copyright (c) 2004 Ingo Kloecker <kloecker@kde.org>
00006 
00007     Libkleopatra is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU General Public License as
00009     published by the Free Software Foundation; either version 2 of the
00010     License, or (at your option) any later version.
00011 
00012     Libkleopatra is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021     In addition, as a special exception, the copyright holders give
00022     permission to link the code of this program with any edition of
00023     the Qt library by Trolltech AS, Norway (or with modified versions
00024     of Qt that use the same license as Qt), and distribute linked
00025     combinations including the two.  You must obey the GNU General
00026     Public License in all respects for all of the code used other than
00027     Qt.  If you modify this file, you may extend this exception to
00028     your version of the file, but you are not obligated to do so.  If
00029     you do not wish to do so, delete this exception statement from
00030     your version.
00031 */
00032 
00033 #ifdef HAVE_CONFIG_H
00034 #include <config.h>
00035 #endif
00036 
00037 #include "kpgpwrapper.h"
00038 
00039 #include "kpgpbackendbase.h"
00040 
00041 #include <kpgpbase.h>
00042 
00043 #include <backends/kpgp/kpgpkeylistjob.h>
00044 //#include <backends/kpgp/kpgpencryptjob.h>
00045 //#include <backends/kpgp/kpgpdecryptjob.h>
00046 //#include <backends/kpgp/kpgpsignjob.h>
00047 //#include <backends/kpgp/kpgpverifydetachedjob.h>
00048 //#include <backends/kpgp/kpgpverifyopaquejob.h>
00049 //#include <backends/kpgp/kpgpkeygenerationjob.h>
00050 //#include <backends/kpgp/kpgpimportjob.h>
00051 //#include <backends/kpgp/kpgpexportjob.h>
00052 //#include <backends/kpgp/kpgpsecretkeyexportjob.h>
00053 //#include <backends/kpgp/kpgpdownloadjob.h>
00054 //#include <backends/kpgp/kpgpdeletejob.h>
00055 //#include <backends/kpgp/kpgpsignencryptjob.h>
00056 //#include <backends/kpgp/kpgpdecryptverifyjob.h>
00057 //#include <backends/kpgp/kpgpcryptoconfig.h>
00058 
00059 KpgpWrapper::KpgpWrapper( const QString & name )
00060   : mName( name ),
00061     mPgpBase( 0 )
00062 {
00063 
00064 }
00065 
00066 KpgpWrapper::~KpgpWrapper()
00067 {
00068 
00069 }
00070 
00071 QString KpgpWrapper::name() const
00072 {
00073   return mName;
00074 }
00075 
00076 QString KpgpWrapper::displayName() const
00077 {
00078   return mName;
00079 }
00080 
00081 Kleo::KeyListJob * KpgpWrapper::keyListJob( bool /*remote*/,
00082                                             bool /*includeSigs*/,
00083                                             bool /*validate*/ ) const
00084 {
00085   return new Kleo::KpgpKeyListJob( pgpBase() );
00086 }
00087 
00088 Kleo::EncryptJob * KpgpWrapper::encryptJob( bool /*armor*/,
00089                                             bool /*textmode*/ ) const
00090 {
00091   return 0;
00092 }
00093 
00094 Kleo::DecryptJob * KpgpWrapper::decryptJob() const
00095 {
00096   return 0;
00097 }
00098 
00099 Kleo::SignJob * KpgpWrapper::signJob( bool /*armor*/, bool /*textMode*/ ) const
00100 {
00101   return 0;
00102 }
00103 
00104 Kleo::VerifyDetachedJob * KpgpWrapper::verifyDetachedJob( bool /*textmode*/ ) const
00105 {
00106   return 0;
00107 }
00108 
00109 Kleo::VerifyOpaqueJob * KpgpWrapper::verifyOpaqueJob( bool /*textmode*/ ) const
00110 {
00111   return 0;
00112 }
00113 
00114 Kleo::KeyGenerationJob * KpgpWrapper::keyGenerationJob() const
00115 {
00116   return 0;
00117 }
00118 
00119 Kleo::ImportJob * KpgpWrapper::importJob() const
00120 {
00121   return 0;
00122 }
00123 
00124 Kleo::ExportJob * KpgpWrapper::publicKeyExportJob( bool /*armor*/ ) const
00125 {
00126   return 0;
00127 }
00128 
00129 Kleo::ExportJob * KpgpWrapper::secretKeyExportJob( bool /*armor*/ ) const
00130 {
00131   return 0;
00132 }
00133 
00134 Kleo::DownloadJob * KpgpWrapper::downloadJob( bool /*armor*/ ) const
00135 {
00136   return 0;
00137 }
00138 
00139 Kleo::DeleteJob * KpgpWrapper::deleteJob() const
00140 {
00141   return 0;
00142 }
00143 
00144 Kleo::SignEncryptJob * KpgpWrapper::signEncryptJob( bool /*armor*/,
00145                                                     bool /*textMode*/ ) const
00146 {
00147   return 0;
00148 }
00149 
00150 Kleo::DecryptVerifyJob * KpgpWrapper::decryptVerifyJob( bool /*textmode*/ ) const
00151 {
00152   return 0;
00153 }
00154 
00155 Kleo::RefreshKeysJob * KpgpWrapper::refreshKeysJob() const
00156 {
00157   return 0;
00158 }
00159 
00160 Kpgp::Base * KpgpWrapper::pgpBase() const
00161 {
00162   if ( !mPgpBase ) {
00163     if ( name() == GPG1_BACKEND_NAME )
00164       mPgpBase = new Kpgp::BaseG();
00165     else if ( name() == PGP2_BACKEND_NAME )
00166       mPgpBase = new Kpgp::Base2();
00167     else if ( name() == PGP5_BACKEND_NAME )
00168       mPgpBase = new Kpgp::Base5();
00169     else if ( name() == PGP6_BACKEND_NAME )
00170       mPgpBase = new Kpgp::Base6();
00171   }
00172   return mPgpBase;
00173 }
KDE Home | KDE Accessibility Home | Description of Access Keys