gpgme - raw RSA operation using GPG public/private keys?

gnupg-user at gnupg-user at
Fri Jul 7 18:01:03 CEST 2017

Hello everybody!

I am looking for a "simple" way to use a GPG public/private RSA key to
do "raw" RSA operations. I have the impression, that gpgme only deals
with "real" OpenPGP data structures, but this does not fit my use case.
This is for an application that is currently based on openssl crypto.

I do have a "plan-b" if there is no simpler way, but given the gpgme,
libgcrypt ecosystem (which I have not really used before) I hope that I
will not have to use this:

  * use gpgme to access gnupg keyrings
  * "export" a key using as an OpenPGP key into an in-memory buffer
  * parse this key from the buffer - extracting RSA numbers
  * put the RSA values into an openssl RSA key structure
  * do the crypto using openssl

This does work - I tested this up to the fourth bullet... but there
surely must be a better way.... however, looking at the gpgme docs I can
find no obvious candidates for RSA operations - gpgme_op_encrypt does
not what I need, as it constructs a PGP message, where I assume it uses
a session key and encrypts that using RSA...


-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20170707/adcedc54/attachment.html>

More information about the Gnupg-users mailing list