diff options
author | Karl-Heinz Zimmer <[email protected]> | 2002-06-25 15:05:59 +0000 |
---|---|---|
committer | Karl-Heinz Zimmer <[email protected]> | 2002-06-25 15:05:59 +0000 |
commit | da40b7130f3622b8ab654ab04ba8644f9ae0b6d8 (patch) | |
tree | 2d2fce03de1ef97b70bd69da670834ee0f5f9fb6 | |
parent | 2002-06-25 Marcus Brinkmann <[email protected]> (diff) | |
download | gpgme-da40b7130f3622b8ab654ab04ba8644f9ae0b6d8.tar.gz gpgme-da40b7130f3622b8ab654ab04ba8644f9ae0b6d8.zip |
Have additional secretOnly parameter at the findCertificates() function to allow for searching only secret keys.
-rw-r--r-- | gpgmeplug/cryptplug.h | 3 | ||||
-rw-r--r-- | gpgmeplug/gpgmeplug.c | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/gpgmeplug/cryptplug.h b/gpgmeplug/cryptplug.h index 03b1715b..95b9433c 100644 --- a/gpgmeplug/cryptplug.h +++ b/gpgmeplug/cryptplug.h @@ -1577,8 +1577,9 @@ bool storeCertificatesFromMessage( const char* ciphertext ); NOTE: The \c certificate parameter must point to an allready allocated block of memory which is large enough to hold the complete list. + If secretOnly is true, only secret keys are returned. */ -bool findCertificates( const char* addressee, char** certificates ); +bool findCertificates( const char* addressee, char** certificates, bool secretOnly ); /*! \ingroup groupCryptAct \brief Encrypts an email message in diff --git a/gpgmeplug/gpgmeplug.c b/gpgmeplug/gpgmeplug.c index 02a6222f..d94ab10b 100644 --- a/gpgmeplug/gpgmeplug.c +++ b/gpgmeplug/gpgmeplug.c @@ -1512,7 +1512,7 @@ bool encryptMessage( const char* cleartext, if( GPGMEPLUG_PROTOCOL == GPGME_PROTOCOL_CMS ) { gpgme_recipients_add_name (rset, - "/CN=test cert 1,OU=Aegypten Project,O=g10 Code GmbH,L=Düsseldorf,C=DE" ); + "/CN=test cert 1,OU=Aegypten Project,O=g10 Code GmbH,L=D�?sseldorf,C=DE" ); fputs( "\nGPGSMPLUG encryptMessage() using test key of Aegypten Project\n", stderr ); } @@ -2300,8 +2300,9 @@ void endListCertificates( struct CertIterator* it ) '\1' separated list. NOTE: The certificate parameter must point to an allready allocated block of memory which is large enough to hold the complete list. + If secretOnly is true, only secret keys are returned. */ -bool findCertificates( const char* addressee, char** certificates ) +bool findCertificates( const char* addressee, char** certificates, bool secretOnly ) { GpgmeCtx ctx; GpgmeError err; @@ -2317,7 +2318,7 @@ bool findCertificates( const char* addressee, char** certificates ) gpgme_new (&ctx); gpgme_set_protocol (ctx, GPGMEPLUG_PROTOCOL); - err = gpgme_op_keylist_start(ctx, addressee, 0); + err = gpgme_op_keylist_start(ctx, addressee, secretOnly ? 1 : 0); while( GPGME_No_Error == err ) { err = gpgme_op_keylist_next(ctx, &rKey); if( GPGME_No_Error == err ) { |