Public Key encryption

Rüdiger Sonderfeld cplusplushelp@gmx.net
Tue, 25 Jun 2002 22:41:16 +0200


Am Samstag, 22. Juni 2002 17:17 schrieben Sie:
> Okay, let me try with another code snippet from GnuPG 1.1.2a. 

I downloaded it and now I'm reading the source

(that's a lot of source *g*)

> I would recommend you download this version because it contains a
> lot of code how to convert the libgcrypt sexp expressions into
> GCRY_MPI (GcryMPI) structs.
>
> keygen.c:
> rc = key_from_sexp( your_pkey_struct, key, "public-key", "ne" );
>
> Sorry that it is so much code but otherwise it's difficult to read it.

Okay now I thing I understand it.

I have a Public and a Private Key in a GCRYP_SEXP struct and I have to 
transform it into a array of 3 MPI structs with the key_from_sexp function. 
(what is the difference to the sexp_to_key function from cipher/pubkey.c?)

But now I have the problem howto convert the data from (unsigned) char * into 
MPI structures and back?