Call gpg with gpgme

Le Roy Francis thecissou98 at hotmail.fr
Sat Sep 17 19:13:55 CEST 2016


My snippet works just fine if not for the pinentry. Is there a way of
avoiding the pinentry pop-up and enter the pin in STDIN ? Is gpg
--pinentry-mode loopback of any use ?

Thanks.
FLR.

Le 17/09/2016 à 13:59, Le Roy Francis a écrit :
> I have found another way, as my project is based on node js. I use the
> child_process package to launch gpg. I have already wrote a function to
> generate a new key pair directly in a smart card. Nonetheless, if I fail
> to create a node js function good enough for my needs, I give your
> solution a try.
> 
> Thanks. 
> FLR. 
> 
> Le 17 sept. 2016, à 13:32, Werner Koch <wk at gnupg.org
> <mailto:wk at gnupg.org>> a écrit:
> 
>     On Fri, 16 Sep 2016 20:45, thecissou98 at hotmail.fr said:
> 
>         Hi, how can I interface directly with gpg via gpgme like in the
>         gpgme_op_edit. Is gpgme_op_spawn of any use in this case ? Is
>         there an
>         equivalent of gpgme_op_assuan_transact_ext for GPG ?
> 
> 
>     Yes, you need to implement the callback for gpgme_op_edit (or
>     gpgme_op_interact in the forthcoming 1.7).  You probably want to build
>     an FSM for this.  If you encounter an unknown keyword simply send a LF,
>     which is what you would have done on the command line too to use the
>     default answer.
> 
>     For an example on how to build such a thing, check out the file
>     src/gpgmeedit.c from GPA.
> 
>     gpgme_op_spawn is of no use for you.
> 
> 
>     Shalom-Salam,
> 
>        Werner
> 
> 
> 
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
> 



More information about the Gnupg-users mailing list