26 #include <gpgmepp/context.h>
28 #include <tdemacros.h>
164 Feature_SignMessages = 1,
165 Feature_VerifySignatures = 2,
166 Feature_EncryptMessages = 3,
167 Feature_DecryptMessages = 4,
168 Feature_SendCertificates = 5,
169 Feature_WarnSignCertificateExpiry = 6,
170 Feature_WarnSignEmailNotInCertificate = 7,
171 Feature_PinEntrySettings = 8,
172 Feature_StoreMessagesWithSigs = 9,
173 Feature_EncryptionCRLs = 10,
174 Feature_WarnEncryptCertificateExpiry = 11,
175 Feature_WarnEncryptEmailNotInCertificate = 12,
176 Feature_StoreMessagesEncrypted = 13,
177 Feature_CheckCertificatePath = 14,
178 Feature_CertificateDirectoryService = 15,
179 Feature_CRLDirectoryService = 16,
180 Feature_CertificateInfo = 17
185 PinRequest_undef = 0,
187 PinRequest_Always = 1,
188 PinRequest_WhenAddingCerts = 2,
189 PinRequest_AlwaysWhenSigning = 3,
190 PinRequest_OncePerSession = 4,
191 PinRequest_AfterMinutes = 5
196 SignatureCompoundMode_undef = 0,
198 SignatureCompoundMode_Opaque = 1,
199 SignatureCompoundMode_Detached = 2
200 } SignatureCompoundMode;
206 SendCert_DontSend = 1,
207 SendCert_SendOwn = 2,
208 SendCert_SendChainWithoutRoot = 3,
209 SendCert_SendChainWithRoot = 4
217 } SignatureAlgorithm;
222 EncryptAlg_undef = 0,
226 EncryptAlg_TripleDES = 3
227 } EncryptionAlgorithm;
232 SignEmail_SignAll = 1,
234 SignEmail_DontSign = 3
238 EncryptEmail_undef = 0,
240 EncryptEmail_EncryptAll = 1,
241 EncryptEmail_Ask = 2,
242 EncryptEmail_DontEncrypt = 3
250 CertSrc_ServerLocal = CertSrc_Server | CertSrc_Local
280 SigStat_VALID = 0x0001,
281 SigStat_GREEN = 0x0002,
282 SigStat_RED = 0x0004,
283 SigStat_KEY_REVOKED = 0x0010,
284 SigStat_KEY_EXPIRED = 0x0020,
285 SigStat_SIG_EXPIRED = 0x0040,
286 SigStat_KEY_MISSING = 0x0080,
287 SigStat_CRL_MISSING = 0x0100,
288 SigStat_CRL_TOO_OLD = 0x0200,
289 SigStat_BAD_POLICY = 0x0400,
290 SigStat_SYS_ERROR = 0x0800,
292 SigStat_NUMERICAL_CODE = 0x8000
294 typedef unsigned long SigStatusFlags;
298 class TDE_EXPORT CryptPlug {
302 virtual ~CryptPlug();
305 gpgme_protocol_t GPGMEPLUG_PROTOCOL;
306 GpgME::Context::Protocol mProtocol;
310 int GPGMEPLUG_OPA_SIGN_INCLUDE_CLEARTEXT;
311 int GPGMEPLUG_OPA_SIGN_MAKE_MIME_OBJECT;
312 int GPGMEPLUG_OPA_SIGN_MAKE_MULTI_MIME;
313 const char * GPGMEPLUG_OPA_SIGN_CTYPE_MAIN;
314 const char * GPGMEPLUG_OPA_SIGN_CDISP_MAIN;
315 const char * GPGMEPLUG_OPA_SIGN_CTENC_MAIN;
316 const char * GPGMEPLUG_OPA_SIGN_CTYPE_VERSION;
317 const char * GPGMEPLUG_OPA_SIGN_CDISP_VERSION;
318 const char * GPGMEPLUG_OPA_SIGN_CTENC_VERSION;
319 const char * GPGMEPLUG_OPA_SIGN_BTEXT_VERSION;
320 const char * GPGMEPLUG_OPA_SIGN_CTYPE_CODE;
321 const char * GPGMEPLUG_OPA_SIGN_CDISP_CODE;
322 const char * GPGMEPLUG_OPA_SIGN_CTENC_CODE;
323 const char * GPGMEPLUG_OPA_SIGN_FLAT_PREFIX;
324 const char * GPGMEPLUG_OPA_SIGN_FLAT_SEPARATOR;
325 const char * GPGMEPLUG_OPA_SIGN_FLAT_POSTFIX;
327 int GPGMEPLUG_DET_SIGN_INCLUDE_CLEARTEXT;
328 int GPGMEPLUG_DET_SIGN_MAKE_MIME_OBJECT;
329 int GPGMEPLUG_DET_SIGN_MAKE_MULTI_MIME;
330 const char * GPGMEPLUG_DET_SIGN_CTYPE_MAIN;
331 const char * GPGMEPLUG_DET_SIGN_CDISP_MAIN;
332 const char * GPGMEPLUG_DET_SIGN_CTENC_MAIN;
333 const char * GPGMEPLUG_DET_SIGN_CTYPE_VERSION;
334 const char * GPGMEPLUG_DET_SIGN_CDISP_VERSION;
335 const char * GPGMEPLUG_DET_SIGN_CTENC_VERSION;
336 const char * GPGMEPLUG_DET_SIGN_BTEXT_VERSION;
337 const char * GPGMEPLUG_DET_SIGN_CTYPE_CODE;
338 const char * GPGMEPLUG_DET_SIGN_CDISP_CODE;
339 const char * GPGMEPLUG_DET_SIGN_CTENC_CODE;
340 const char * GPGMEPLUG_DET_SIGN_FLAT_PREFIX;
341 const char * GPGMEPLUG_DET_SIGN_FLAT_SEPARATOR;
342 const char * GPGMEPLUG_DET_SIGN_FLAT_POSTFIX;
344 int __GPGMEPLUG_SIGNATURE_CODE_IS_BINARY;
347 int GPGMEPLUG_ENC_INCLUDE_CLEARTEXT;
348 int GPGMEPLUG_ENC_MAKE_MIME_OBJECT;
349 int GPGMEPLUG_ENC_MAKE_MULTI_MIME;
350 const char * GPGMEPLUG_ENC_CTYPE_MAIN;
351 const char * GPGMEPLUG_ENC_CDISP_MAIN;
352 const char * GPGMEPLUG_ENC_CTENC_MAIN;
353 const char * GPGMEPLUG_ENC_CTYPE_VERSION;
354 const char * GPGMEPLUG_ENC_CDISP_VERSION;
355 const char * GPGMEPLUG_ENC_CTENC_VERSION;
356 const char * GPGMEPLUG_ENC_BTEXT_VERSION;
357 const char * GPGMEPLUG_ENC_CTYPE_CODE;
358 const char * GPGMEPLUG_ENC_CDISP_CODE;
359 const char * GPGMEPLUG_ENC_CTENC_CODE;
360 const char * GPGMEPLUG_ENC_FLAT_PREFIX;
361 const char * GPGMEPLUG_ENC_FLAT_SEPARATOR;
362 const char * GPGMEPLUG_ENC_FLAT_POSTFIX;
363 int __GPGMEPLUG_ENCRYPTED_CODE_IS_BINARY;
368 #define CRYPTPLUG_CERT_DOES_NEVER_EXPIRE 365000
369 #define CRYPTPLUG_ERR_WRONG_KEY_USAGE 0x7070
383 bool initialize(
void );
807 struct SignatureMetaDataExtendedInfo
809 struct tm* creation_time;
810 SigStatusFlags sigStatusFlags;
820 unsigned long algo_num;
821 unsigned long validity;
822 unsigned long userid_num;
823 unsigned long keylen;
824 unsigned long key_created;
825 unsigned long key_expires;
830 struct SignatureMetaData {
832 struct SignatureMetaDataExtendedInfo* extended_info;
833 int extended_info_count;
858 bool checkMessageSignature(
char** cleartext,
859 const char* signaturetext,
860 bool signatureIsBinary,
862 struct SignatureMetaData* sigmeta,
864 const char* unknownAttrsHandling );
877 bool decryptMessage(
const char* ciphertext,
880 const char** cleartext,
881 const char* certificate,
896 bool decryptAndCheckMessage(
const char* ciphertext,
899 const char** cleartext,
900 const char* certificate,
901 bool* signatureFound,
902 struct SignatureMetaData* sigmeta,
906 const char* unknownAttrsHandling );
913 struct CertificateInfo {
925 unsigned long created;
926 unsigned long expire;
933 struct DnPair *dnarray;
939 GpgME::ImportResult importCertificateFromMem(
const char* data,
size_t length );
942 class SMIMECryptPlug :
public CryptPlug {
947 class OpenPGPCryptPlug :
public CryptPlug {
This class provides C++ access to the CRYPTPLUG API.
void init_StructuringInfo(struct StructuringInfo *s)
If you are not planning to write your own cryptography plugin you should ignore this function!
bool hasFeature(::Feature)
This function returns true if the specified feature is available in the plugin, and false otherwise.
void free_StructuringInfo(struct StructuringInfo *s)
Important method for freeing all memory that was allocated for the char* members of a StructuringInfo...
Information record returned by signing and by encrypting functions - this record should be used toget...
char * contentTypeVersion
char * contentDispVersion
char * contentTEncVersion