23 #include <tqcstring.h>
24 #include <tqstringlist.h>
27 #include "kpgpblock.h"
41 virtual int encrypt( Block& , const KeyIDList& ) { return OK; }
44 virtual int clearsign( Block& , const TQString& ) { return OK; }
47 virtual int encsign( Block& , const KeyIDList& ,
48 const TQString& = TQString::null) { return OK; }
51 virtual int decrypt( Block& , const TQString& = TQString::null) { return OK; }
54 virtual int verify( Block& block ) { return decrypt( block, 0 ); }
62 virtual Key* readPublicKey( const KeyID&, const bool = false,
67 virtual KeyList publicKeys( const TQStringList & = TQStringList() )
71 virtual KeyList secretKeys( const TQStringList & = TQStringList() )
76 virtual TQCString getAsciiPublicKey( const KeyID& ) { return TQCString(); }
80 virtual int signKey( const KeyID& , const TQString& ) { return OK; }
85 virtual TQString lastErrorMessage() const;
89 virtual int run( const char *cmd, const TQString &passphrase = TQString::null,
90 bool onlyReadFromPGP = false );
91 virtual int runGpg( const char *cmd, const TQString &passphrase = TQString::null,
92 bool onlyReadFromGnuPG = false );
95 TQCString addUserId();
110 class Base2 : public Base
117 virtual int encrypt( Block& block, const KeyIDList& recipients );
118 virtual int clearsign( Block& block, const TQString &passphrase );
119 virtual int encsign( Block& block, const KeyIDList& recipients,
120 const TQString &passphrase = TQString::null );
121 virtual int decrypt( Block& block, const TQString &passphrase = TQString::null );
122 virtual int verify( Block& block ) { return decrypt( block, 0 ); }
124 virtual Key* readPublicKey( const KeyID& keyID,
125 const bool readTrust = false,
127 virtual KeyList publicKeys( const TQStringList & patterns = TQStringList() );
128 virtual KeyList secretKeys( const TQStringList & patterns = TQStringList() );
129 virtual TQCString getAsciiPublicKey( const KeyID& keyID );
130 virtual int signKey( const KeyID& keyID, const TQString &passphrase );
133 KeyList doGetPublicKeys( const TQCString & cmd,
134 const TQStringList & patterns );
135 virtual KeyList parseKeyList( const TQCString&, bool );
138 Key* parsePublicKeyData( const TQCString& output, Key* key = 0 );
139 void parseTrustDataForKey( Key* key, const TQCString& str );
142 class BaseG : public Base
149 virtual int encrypt( Block& block, const KeyIDList& recipients );
150 virtual int clearsign( Block& block, const TQString &passphrase );
151 virtual int encsign( Block& block, const KeyIDList& recipients,
152 const TQString &passphrase = TQString::null );
153 virtual int decrypt( Block& block, const TQString &passphrase = TQString::null );
154 virtual int verify( Block& block ) { return decrypt( block, 0 ); }
156 virtual Key* readPublicKey( const KeyID& keyID,
157 const bool readTrust = false,
159 virtual KeyList publicKeys( const TQStringList & patterns = TQStringList() );
160 virtual KeyList secretKeys( const TQStringList & patterns = TQStringList() );
161 virtual TQCString getAsciiPublicKey( const KeyID& keyID );
162 virtual int signKey( const KeyID& keyID, const TQString &passphrase );
165 Key* parseKeyData( const TQCString& output, int& offset, Key* key = 0 );
166 KeyList parseKeyList( const TQCString&, bool );
170 class Base5 : public Base
177 virtual int encrypt( Block& block, const KeyIDList& recipients );
178 virtual int clearsign( Block& block, const TQString &passphrase );
179 virtual int encsign( Block& block, const KeyIDList& recipients,
180 const TQString &passphrase = TQString::null );
181 virtual int decrypt( Block& block, const TQString &passphrase = TQString::null );
182 virtual int verify( Block& block ) { return decrypt( block, 0 ); }
184 virtual Key* readPublicKey( const KeyID& keyID,
185 const bool readTrust = false,
187 virtual KeyList publicKeys( const TQStringList & patterns = TQStringList() );
188 virtual KeyList secretKeys( const TQStringList & patterns = TQStringList() );
189 virtual TQCString getAsciiPublicKey( const KeyID& keyID );
190 virtual int signKey( const KeyID& keyID, const TQString &passphrase );
193 Key* parseKeyData( const TQCString& output, int& offset, Key* key = 0 );
194 Key* parseSingleKey( const TQCString& output, Key* key = 0 );
195 KeyList parseKeyList( const TQCString& output, bool );
196 void parseTrustDataForKey( Key* key, const TQCString& str );
200 class Base6 : public Base2
207 virtual int decrypt( Block& block, const TQString &passphrase = TQString::null );
208 virtual int verify( Block& block ) { return decrypt( block, 0 ); }
210 virtual Key* readPublicKey( const KeyID& keyID,
211 const bool readTrust = false,
213 virtual KeyList publicKeys( const TQStringList & patterns = TQStringList() );
214 virtual KeyList secretKeys( const TQStringList & patterns = TQStringList() );
216 virtual int isVersion6();
219 virtual KeyList parseKeyList( const TQCString &, bool );
222 Key* parseKeyData( const TQCString& output, int& offset, Key* key = 0 );
223 Key* parseSingleKey( const TQCString& output, Key* key = 0 );
224 void parseTrustDataForKey( Key* key, const TQCString& str );
231 Base::lastErrorMessage() const
|