how to encrypt raw data using public rsa key and gnutls API?

Leandro Santiago leandrosansilva at
Tue Jul 26 20:36:14 CEST 2011

Hello to all. I'm new with gnutls, and I have a small class which get
the rsa private key from a pem encoded file (generated by openssl) and
this class uses openssl. The problem is now I have to reimplement this
class but using gnutls (or libgcrypt, I don't know).

The second problem is I can't find how to do it using these libraries.
So I need to known if you can help me.

So my what I need to do is, step by step: open a file which a rsa
public key (I have only the public key) encoded with pem (os even get
the content in a char*, or in der format) and use this key to encoder
a sequence of bytes. I don't need the keys I am already using are
compatible with the new implementation.

My class can be found in the adress It
depends only on openssl and boost-thread. I compile with success on
Ubuntu 11.04 320bit


More information about the Gnutls-help mailing list