thanks :)
pubKey is supposed to be used to decrypt a string previously encrypted with 
the privateKey (rsa_private_encrypt)..

by the way... is it possible? i have seen some code and openssl itself to 
encrypt using public key and decrypt using the private key... 

El Miércoles 26 Diciembre 2001 19:09, escribiste:
> Ricardo Guerra wrote:
> > hi all,
> >
> > i've been having trouble with this pice of code, i get a segmentation
> > fault when reading the public key, this is the way i generated both
> > private and public keys.
> >
> > priv Key: openssl genrsa -out priv.key 1024
> > pub Key: cat pub.key | openssl rsa -pubout > pub.key
> >
> > does anyone have any idea about what does this happen?
> >
> > i'm using rh linux 6.2 with openssl 0.9.6b 9
> >
> > int FOROLicense::LoadPublicKey (char *name)
> > {
> >    FILE *file;
> >    if ((file=fopen(name, "rb"))== NULL)
> >          return 0;
> >
> >    pubKey=*PEM_read_RSAPublicKey(file, NULL, NULL, NULL);
> >
> >    fclose (file);
> >    loadedPub=1;
> >    return loadedPub;
> > }
>
> Not sure what the pubkey stuff is supposed to be doing. pubKey should be
> declared somewhere as:
>
> RSA *pubKey;
>
> then call:
>
> pubKey = PEM_read_RSA_PUBKEY(file, NULL, NULL, NULL);
>
> (not RSAPublicKey).
>
> Steve.
------------------------------------------------------------------
This email is confidential and intended solely for the use of the individual to whom 
it is addressed. Any views or opinions presented are solely those of the author and do 
not necessarily represent those of SchlumbergerSema. 
If you are not the intended recipient, be advised that you have received this email in 
error and that any use, dissemination, forwarding, printing, or copying of this email 
is strictly prohibited.
------------------------------------------------------------------

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to