certmanager/lib
cryptobackend.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __KLEO_CRYPTOBACKEND_H__
00034 #define __KLEO_CRYPTOBACKEND_H__
00035
00036 #include <tqstring.h>
00037
00038 namespace Kleo {
00039 class CryptoConfig;
00040 class KeyListJob;
00041 class KeyGenerationJob;
00042 class ImportJob;
00043 class ExportJob;
00044 class DownloadJob;
00045 class DeleteJob;
00046 class EncryptJob;
00047 class DecryptJob;
00048 class SignJob;
00049 class VerifyDetachedJob;
00050 class VerifyOpaqueJob;
00051 class SignEncryptJob;
00052 class DecryptVerifyJob;
00053 class RefreshKeysJob;
00054 class SpecialJob;
00055 }
00056
00057 class TQString;
00058 class TQVariant;
00059 template <typename T_Key, typename T_Value> class TQMap;
00060
00061 namespace Kleo {
00062
00063 class CryptoBackend {
00064 public:
00065 class Protocol;
00066
00067 static const char OpenPGP[];
00068 static const char SMIME[];
00069
00070 virtual ~CryptoBackend() {}
00071
00072 virtual TQString name() const = 0;
00073 virtual TQString displayName() const = 0;
00074
00075 virtual bool checkForOpenPGP( TQString * reason=0 ) const = 0;
00076 virtual bool checkForSMIME( TQString * reason=0 ) const = 0;
00077 virtual bool checkForProtocol( const char * name, TQString * reason=0 ) const = 0;
00078
00079 virtual bool supportsOpenPGP() const = 0;
00080 virtual bool supportsSMIME() const = 0;
00081 virtual bool supportsProtocol( const char * name ) const = 0;
00082
00083 virtual CryptoConfig * config() const = 0;
00084
00085 virtual Protocol * openpgp() const = 0;
00086 virtual Protocol * smime() const = 0;
00087 virtual Protocol * protocol( const char * name ) const = 0;
00088
00089 virtual const char * enumerateProtocols( int i ) const = 0;
00090 };
00091
00092 class CryptoBackend::Protocol {
00093 public:
00094 virtual ~Protocol() {}
00095
00096 virtual TQString name() const = 0;
00097
00098 virtual TQString displayName() const = 0;
00099
00100 virtual KeyListJob * keyListJob( bool remote=false, bool includeSigs=false, bool validate=false ) const = 0;
00101 virtual EncryptJob * encryptJob( bool armor=false, bool textmode=false ) const = 0;
00102 virtual DecryptJob * decryptJob() const = 0;
00103 virtual SignJob * signJob( bool armor=false, bool textMode=false ) const = 0;
00104 virtual VerifyDetachedJob * verifyDetachedJob( bool textmode=false) const = 0;
00105 virtual VerifyOpaqueJob * verifyOpaqueJob( bool textmode=false ) const = 0;
00106 virtual KeyGenerationJob * keyGenerationJob() const = 0;
00107 virtual ImportJob * importJob() const = 0;
00108 virtual ExportJob * publicKeyExportJob( bool armor=false ) const = 0;
00109
00110 virtual ExportJob * secretKeyExportJob( bool armor=false, const TQString& charset = TQString::null ) const = 0;
00111 virtual DownloadJob * downloadJob( bool armor=false ) const = 0;
00112 virtual DeleteJob * deleteJob() const = 0;
00113 virtual SignEncryptJob * signEncryptJob( bool armor=false, bool textMode=false ) const = 0;
00114 virtual DecryptVerifyJob * decryptVerifyJob( bool textmode=false ) const = 0;
00115 virtual RefreshKeysJob * refreshKeysJob() const = 0;
00116
00117 virtual SpecialJob * specialJob( const char * type, const TQMap<TQString,TQVariant> & args ) const = 0;
00118 };
00119
00120 }
00121
00122 #endif // __KLEO_CRYPTOBACKEND_H__
|