Public Key encryption

Rüdiger Sonderfeld cplusplushelp@gmx.net
Sat, 22 Jun 2002 16:38:00 +0200


Am Sonntag, 16. Juni 2002 17:22 schrieben Sie:
> pkey is the MPI array (GCRY_MPI).

?? Oh I don't understand the MPI stuff :(

Okay I try it again. I have created key with this function

typedef GCRY_SEXP pkkey;

int crypto_rsagenkey(pkkey *key,int bits)
{
  int ret;
  GCRY_SEXP parms;
  gcry_sexp_build( &parms, NULL, "(genkey(rsa(nbits %d)))", bits);
  ret=gcry_pk_genkey( key,parms );
  gcry_sexp_release( parms );
  return ret;
}

now there should be a public and a private key at the adress of key. Now I 
wont to crypt something ("hello, world!" for example) now I have to split the 
GCRY_SEXP variable into the public and the private key (am I right?) 
is the MPI array the result of this?