certmanager/lib

kpgpwrapper.cpp
1 /*
2  kpgpwrapper.cpp
3 
4  This file is part of libkleopatra, the KDE keymanagement library
5  Copyright (c) 2004 Ingo Kloecker <kloecker@kde.org>
6 
7  Libkleopatra is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of the
10  License, or (at your option) any later version.
11 
12  Libkleopatra is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  In addition, as a special exception, the copyright holders give
22  permission to link the code of this program with any edition of
23  the TQt library by Trolltech AS, Norway (or with modified versions
24  of TQt that use the same license as TQt), and distribute linked
25  combinations including the two. You must obey the GNU General
26  Public License in all respects for all of the code used other than
27  TQt. If you modify this file, you may extend this exception to
28  your version of the file, but you are not obligated to do so. If
29  you do not wish to do so, delete this exception statement from
30  your version.
31 */
32 
33 #ifdef HAVE_CONFIG_H
34 #include <config.h>
35 #endif
36 
37 #include "kpgpwrapper.h"
38 
39 #include "kpgpbackendbase.h"
40 
41 #include <kpgpbase.h>
42 
43 #include <backends/kpgp/kpgpkeylistjob.h>
44 //#include <backends/kpgp/kpgpencryptjob.h>
45 //#include <backends/kpgp/kpgpdecryptjob.h>
46 //#include <backends/kpgp/kpgpsignjob.h>
47 //#include <backends/kpgp/kpgpverifydetachedjob.h>
48 //#include <backends/kpgp/kpgpverifyopaquejob.h>
49 //#include <backends/kpgp/kpgpkeygenerationjob.h>
50 //#include <backends/kpgp/kpgpimportjob.h>
51 //#include <backends/kpgp/kpgpexportjob.h>
52 //#include <backends/kpgp/kpgpsecretkeyexportjob.h>
53 //#include <backends/kpgp/kpgpdownloadjob.h>
54 //#include <backends/kpgp/kpgpdeletejob.h>
55 //#include <backends/kpgp/kpgpsignencryptjob.h>
56 //#include <backends/kpgp/kpgpdecryptverifyjob.h>
57 //#include <backends/kpgp/kpgpcryptoconfig.h>
58 
59 KpgpWrapper::KpgpWrapper( const TQString & name )
60  : mName( name ),
61  mPgpBase( 0 )
62 {
63 
64 }
65 
66 KpgpWrapper::~KpgpWrapper()
67 {
68 
69 }
70 
71 TQString KpgpWrapper::name() const
72 {
73  return mName;
74 }
75 
76 TQString KpgpWrapper::displayName() const
77 {
78  return mName;
79 }
80 
81 Kleo::KeyListJob * KpgpWrapper::keyListJob( bool /*remote*/,
82  bool /*includeSigs*/,
83  bool /*validate*/ ) const
84 {
85  return new Kleo::KpgpKeyListJob( pgpBase() );
86 }
87 
88 Kleo::EncryptJob * KpgpWrapper::encryptJob( bool /*armor*/,
89  bool /*textmode*/ ) const
90 {
91  return 0;
92 }
93 
94 Kleo::DecryptJob * KpgpWrapper::decryptJob() const
95 {
96  return 0;
97 }
98 
99 Kleo::SignJob * KpgpWrapper::signJob( bool /*armor*/, bool /*textMode*/ ) const
100 {
101  return 0;
102 }
103 
104 Kleo::VerifyDetachedJob * KpgpWrapper::verifyDetachedJob( bool /*textmode*/ ) const
105 {
106  return 0;
107 }
108 
109 Kleo::VerifyOpaqueJob * KpgpWrapper::verifyOpaqueJob( bool /*textmode*/ ) const
110 {
111  return 0;
112 }
113 
114 Kleo::KeyGenerationJob * KpgpWrapper::keyGenerationJob() const
115 {
116  return 0;
117 }
118 
119 Kleo::ImportJob * KpgpWrapper::importJob() const
120 {
121  return 0;
122 }
123 
124 Kleo::ExportJob * KpgpWrapper::publicKeyExportJob( bool /*armor*/ ) const
125 {
126  return 0;
127 }
128 
129 Kleo::ExportJob * KpgpWrapper::secretKeyExportJob( bool /*armor*/ ) const
130 {
131  return 0;
132 }
133 
134 Kleo::DownloadJob * KpgpWrapper::downloadJob( bool /*armor*/ ) const
135 {
136  return 0;
137 }
138 
139 Kleo::DeleteJob * KpgpWrapper::deleteJob() const
140 {
141  return 0;
142 }
143 
144 Kleo::SignEncryptJob * KpgpWrapper::signEncryptJob( bool /*armor*/,
145  bool /*textMode*/ ) const
146 {
147  return 0;
148 }
149 
150 Kleo::DecryptVerifyJob * KpgpWrapper::decryptVerifyJob( bool /*textmode*/ ) const
151 {
152  return 0;
153 }
154 
155 Kleo::RefreshKeysJob * KpgpWrapper::refreshKeysJob() const
156 {
157  return 0;
158 }
159 
160 Kpgp::Base * KpgpWrapper::pgpBase() const
161 {
162  if ( !mPgpBase ) {
163  if ( name() == GPG1_BACKEND_NAME )
164  mPgpBase = new Kpgp::BaseG();
165  else if ( name() == PGP2_BACKEND_NAME )
166  mPgpBase = new Kpgp::Base2();
167  else if ( name() == PGP5_BACKEND_NAME )
168  mPgpBase = new Kpgp::Base5();
169  else if ( name() == PGP6_BACKEND_NAME )
170  mPgpBase = new Kpgp::Base6();
171  }
172  return mPgpBase;
173 }
An abstract base class for asynchronous decrypters.
Definition: decryptjob.h:62
An abstract base class for asynchronous combined decrypters and verifiers.
An abstract base class for asynchronous deleters.
Definition: deletejob.h:58
An abstract base class for asynchronous downloaders.
Definition: downloadjob.h:61
An abstract base class for asynchronous encrypters.
Definition: encryptjob.h:64
An abstract base class for asynchronous exporters.
Definition: exportjob.h:61
An abstract base class for asynchronous importers.
Definition: importjob.h:62
An abstract base class for asynchronous key generation.
An abstract base class for asynchronous key listers.
Definition: keylistjob.h:65
An abstract base class for asynchronous key refreshers.
An abstract base class for asynchronous combined signing and encrypting.
An abstract base class for asynchronous signing.
Definition: signjob.h:65
An abstract base class for asynchronous verification of detached signatures.
An abstract base class for asynchronous verification of opaque signatures.