More feature selectors

Plugin says which features it supports
This commit is contained in:
Matthias Kalle Dalheimer 2002-03-21 13:14:20 +00:00
parent 6cee0a4f3f
commit 770116c84f
2 changed files with 37 additions and 13 deletions

View File

@ -161,14 +161,25 @@ typedef char bool;
*/
// dummy values:
typedef enum {
CryptPlugFeat_undef = 0,
Feature_undef = 0,
CryptPlugFeat_SignMessages = 1,
CryptPlugFeat_VerifySignatures = 2,
CryptPlugFeat_EncryptMessages = 3,
CryptPlugFeat_DecryptMessages = 4 // more to follow ...
Feature_SignMessages = 1,
Feature_VerifySignatures = 2,
Feature_EncryptMessages = 3,
Feature_DecryptMessages = 4,
Feature_SendCertificates = 5,
Feature_WarnSignCertificateExpiry = 6,
Feature_WarnSignEmailNotInCertificate = 7,
Feature_PinEntrySettings = 8,
Feature_StoreMessagesWithSigs = 9,
Feature_EncryptionCRLs = 10,
Feature_WarnEncryptCertificateExpiry = 11,
Feature_WarnEncryptEmailNotInCertificate = 12,
Feature_StoreMessagesEncrypted = 13,
Feature_CheckCertificatePath = 14,
Feature_CertificateDirectoryService = 15,
Feature_CRLDirectoryService = 16
} Feature;
// dummy values

View File

@ -228,14 +228,27 @@ void deinitialize()
bool hasFeature( Feature flag )
{
// our own plugins are supposed to support everything
switch ( flag ) {
case CryptPlugFeat_SignMessages: return true;
case CryptPlugFeat_VerifySignatures: return true;
case CryptPlugFeat_EncryptMessages: return true;
case CryptPlugFeat_DecryptMessages: return true;
// undefined or not yet implemented:
case CryptPlugFeat_undef: return false;
default: return false;
case Feature_SignMessages: return true;
case Feature_VerifySignatures: return true;
case Feature_EncryptMessages: return true;
case Feature_DecryptMessages: return true;
case Feature_SendCertificates: return true;
case Feature_WarnSignCertificateExpiry: return true;
case Feature_WarnSignEmailNotInCertificate: return true;
case Feature_PinEntrySettings: return true;
case Feature_StoreMessagesWithSigs: return true;
case Feature_EncryptionCRLs: return true;
case Feature_WarnEncryptCertificateExpiry: return true;
case Feature_WarnEncryptEmailNotInCertificate: return true;
case Feature_StoreMessagesEncrypted: return true;
case Feature_CheckCertificatePath: return true;
case Feature_CertificateDirectoryService: return true;
case Feature_CRLDirectoryService: return true;
// undefined or not yet implemented:
case Feature_undef: return false;
default: return false;
}
}