RE: Use of Passphrase Callback

2017-10-09 Thread SHARMA Sandhya (MORPHO)
Reminder


From: SHARMA Sandhya (MORPHO)
Sent: Tuesday, September 26, 2017 5:35 PM
To: 'gnupg-users@gnupg.org' <gnupg-users@gnupg.org>
Subject: RE: Use of Passphrase Callback

Hello,

Does anyone has idea how to implement this.
As I have urgent business need to do it ASAP.

Thanks,
Sandhya

From: SHARMA Sandhya (MORPHO)
Sent: Friday, September 22, 2017 6:21 PM
To: 'gnupg-users@gnupg.org' 
<gnupg-users@gnupg.org<mailto:gnupg-users@gnupg.org>>
Subject: Use of Passphrase Callback

Hello,

I am Using gnupg on windows and want to use "Passphrase Callback" functionality 
to input password for private key.
My current lines of code is:
error = gpgme_set_pinentry_mode(context,GPGME_PINENTRY_MODE_LOOPBACK);
gpgme_passphrase_cb_t func = _callback;
gpgme_pinentry_mode_t pinMode =  gpgme_get_pinentry_mode(context);
void *pp = 0;
gpgme_set_passphrase_cb(context,func,pp);

and declaration of gpgme_passphrase_cb_t is
gpgme_error_t passphrase_callback(void *opaque, const char *uid_hint, const 
char *desc,int prev_was_bad, int fd)

but breakpoint on this function never hits.
Kindly provide help on this or any example used to implement Passphrase 
CallBack.



Thanks & Regards,
Sandhya Sharma

#
" This e-mail and any attached documents may contain confidential or 
proprietary information. If you are not the intended recipient, you are 
notified that any dissemination, copying of this e-mail and any attachments 
thereto or use of their contents by any means whatsoever is strictly 
prohibited. If you have received this e-mail in error, please advise the sender 
immediately and delete this e-mail and all attached documents from your 
computer system."
#
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


RE: Use of Passphrase Callback

2017-09-26 Thread SHARMA Sandhya (MORPHO)
Hello,

Does anyone has idea how to implement this.
As I have urgent business need to do it ASAP.

Thanks,
Sandhya

From: SHARMA Sandhya (MORPHO)
Sent: Friday, September 22, 2017 6:21 PM
To: 'gnupg-users@gnupg.org' <gnupg-users@gnupg.org>
Subject: Use of Passphrase Callback

Hello,

I am Using gnupg on windows and want to use "Passphrase Callback" functionality 
to input password for private key.
My current lines of code is:
error = gpgme_set_pinentry_mode(context,GPGME_PINENTRY_MODE_LOOPBACK);
gpgme_passphrase_cb_t func = _callback;
gpgme_pinentry_mode_t pinMode =  gpgme_get_pinentry_mode(context);
void *pp = 0;
gpgme_set_passphrase_cb(context,func,pp);

and declaration of gpgme_passphrase_cb_t is
gpgme_error_t passphrase_callback(void *opaque, const char *uid_hint, const 
char *desc,int prev_was_bad, int fd)

but breakpoint on this function never hits.
Kindly provide help on this or any example used to implement Passphrase 
CallBack.



Thanks & Regards,
Sandhya Sharma

#
" This e-mail and any attached documents may contain confidential or 
proprietary information. If you are not the intended recipient, you are 
notified that any dissemination, copying of this e-mail and any attachments 
thereto or use of their contents by any means whatsoever is strictly 
prohibited. If you have received this e-mail in error, please advise the sender 
immediately and delete this e-mail and all attached documents from your 
computer system."
#
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Use of Passphrase Callback

2017-09-22 Thread SHARMA Sandhya (MORPHO)
Hello,

I am Using gnupg on windows and want to use "Passphrase Callback" functionality 
to input password for private key.
My current lines of code is:
error = gpgme_set_pinentry_mode(context,GPGME_PINENTRY_MODE_LOOPBACK);
gpgme_passphrase_cb_t func = _callback;
gpgme_pinentry_mode_t pinMode =  gpgme_get_pinentry_mode(context);
void *pp = 0;
gpgme_set_passphrase_cb(context,func,pp);

and declaration of gpgme_passphrase_cb_t is
gpgme_error_t passphrase_callback(void *opaque, const char *uid_hint, const 
char *desc,int prev_was_bad, int fd)

but breakpoint on this function never hits.
Kindly provide help on this or any example used to implement Passphrase 
CallBack.



Thanks & Regards,
Sandhya Sharma

#
" This e-mail and any attached documents may contain confidential or 
proprietary information. If you are not the intended recipient, you are 
notified that any dissemination, copying of this e-mail and any attachments 
thereto or use of their contents by any means whatsoever is strictly 
prohibited. If you have received this e-mail in error, please advise the sender 
immediately and delete this e-mail and all attached documents from your 
computer system."
#
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Signing data with user specified Key

2017-09-14 Thread SHARMA Sandhya (MORPHO)
Hello,

I am using GPG4Win and have to sign data with a specified key through my code 
in C++.But I didn't find much help on how to specify key for signing data in 
GPG document.
Please find the below lines of code I am using for signing data:
error = gpgme_op_sign(context,Plaindata,Signdata,GPGME_SIG_MODE_NORMAL);
   PRet = (char*)gpgme_strerror(error) ;
   gpgme_sign_result_t result = gpgme_op_sign_result(context);


Thanks & Regards
Sandhya Sharma

#
" This e-mail and any attached documents may contain confidential or 
proprietary information. If you are not the intended recipient, you are 
notified that any dissemination, copying of this e-mail and any attachments 
thereto or use of their contents by any means whatsoever is strictly 
prohibited. If you have received this e-mail in error, please advise the sender 
immediately and delete this e-mail and all attached documents from your 
computer system."
#
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Invalid Crypto Error

2017-07-27 Thread SHARMA Sandhya (MORPHO)
Hello All,

I have to use GPG for windows.For that i have installed GPG4Win in my system 
and try to use it through C++ code using DLL libgpgme-glib-11.
Getting "Invalid crytpto Engine" while calling "gpgme_engine_check_version".

Plz find the code snippet::
void _stdcall LoadGPG()
{
gpgme_error_t error;
char* p;
gpgme_key_t recipients[2] = {NULL, NULL};
gpgme_data_t clear_text, encrypted_text;
gpgme_encrypt_result_t result;
gpgme_engine_info_t info;
gpgme_keylist_mode_t keymode;
gpgme_protocol_t proto;

/* Initialize the locale environment. */
setlocale(LC_ALL, "");
int n =gpgme_set_global_flag("disable-gpgconf","1");

n = gpgme_set_global_flag("bindir","C://Program Files (x86)GNUGnuPG");

p = (char *) gpgme_check_version (NULL);//to initialize gpg



gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL));
#ifdef LC_MESSAGES
gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL));
#endif
gpgme_ctx_t *context = (gpgme_ctx_t *)malloc(sizeof *context);
error = gpgme_new(context);
error = gpgme_set_protocol (*context, GPGME_PROTOCOL_OpenPGP);

keymode = gpgme_get_keylist_mode(*context);
info = gpgme_ctx_get_engine_info(*context);

/* Setting the output type must be done at the beginning */
gpgme_set_armor(*context, 1);

error = gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP);
pEngineinfoerror1 = gpgme_strerror(error) ;
gpgme_data_t data;
gpgme_data_t cipher;

gpgme_error_t e = gpgme_data_new();

e = gpgme_data_new();

gpgme_data_set_file_name(data, "C:\\Logs\\test.txt");
error= gpgme_op_encrypt(*context,0,(gpgme_encrypt_flags_t)0,data,cipher);
pEngineinfoerror1 = gpgme_strerror(error) ;

}
Please let me know the solution for it ASAP.


Thanks & Regards
Sandhya Sharma

#
" This e-mail and any attached documents may contain confidential or 
proprietary information. If you are not the intended recipient, you are 
notified that any dissemination, copying of this e-mail and any attachments 
thereto or use of their contents by any means whatsoever is strictly 
prohibited. If you have received this e-mail in error, please advise the sender 
immediately and delete this e-mail and all attached documents from your 
computer system."
#
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users