From 4917d176bfed2a88c200c5222dc2f772c3f4242c Mon Sep 17 00:00:00 2001 From: Matthias Kalle Dalheimer Date: Wed, 17 Apr 2002 14:16:53 +0000 Subject: [PATCH] Implemented requesting certs --- trunk/gpgmeplug/cryptplug.h | 7 ++----- trunk/gpgmeplug/gpgmeplug.c | 21 ++++++++++++++++++--- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/trunk/gpgmeplug/cryptplug.h b/trunk/gpgmeplug/cryptplug.h index c390b6e..fddaf17 100644 --- a/trunk/gpgmeplug/cryptplug.h +++ b/trunk/gpgmeplug/cryptplug.h @@ -1596,12 +1596,9 @@ const char* requestCertificateDialog( void ); /*! \ingroup groupCertAct \brief Generates a prototype certificate with the data provided - in the first four parameters and sends it via email to the CA - specified in \c ca_address. + in the four parameter. */ -bool requestDecentralCertificate( const char* name, const char* - email, const char* organization, const char* department, - const char* ca_address ); +bool requestDecentralCertificate( const char* certparms, char** generatedKey ); /*! \ingroup groupCertAct \brief Requests a certificate in a PSE from the CA diff --git a/trunk/gpgmeplug/gpgmeplug.c b/trunk/gpgmeplug/gpgmeplug.c index 74fb3c2..342c7bd 100644 --- a/trunk/gpgmeplug/gpgmeplug.c +++ b/trunk/gpgmeplug/gpgmeplug.c @@ -1510,9 +1510,24 @@ bool decryptAndCheckMessage( const char* ciphertext, const char* requestCertificateDialog(){ return 0; } -bool requestDecentralCertificate( const char* name, const char* - email, const char* organization, const char* department, - const char* ca_address ){ return true; } +bool requestDecentralCertificate( const char* certparms, char** generatedKey ) +{ + GpgmeCtx ctx; + GpgmeError err = gpgme_new (&ctx); + if( err != GPGME_No_Error ) + return false; + + gpgme_set_protocol (ctx, GPGMEPLUG_PROTOCOL); + + gpgme_set_armor (ctx, __GPGMEPLUG_SIGNATURE_CODE_IS_BINARY ? 0 : 1); + + if( gpgme_op_genkey( ctx, certparms, NULL, NULL ) == GPGME_No_Error ) + return true; + else + return false; + + gpgme_release( ctx ); +} bool requestCentralCertificateAndPSE( const char* name, const char* email, const char* organization, const char* department, -- 2.26.2