hi,

when i do this, i get a segfault on "RSA_check_key(&pubKey)", the public key 
is generated via cat priv.key | openssl rs -pubout > pub.key .. the real 
problem is using rsa_public_decrypt(), the decrypted data makes no sense.. so 
i wondered if the public key was correct, but using RSA_check_key it fails, 
but i'm able to use RSA_size(&pubKey)


{
  FILE *file;
  if ((file=fopen(name, "r"))== NULL)
    return 0;

  //    pubKey=*PEM_read_RSAPublicKey(file, NULL, NULL, NULL);
  pubKey=*PEM_read_RSA_PUBKEY(file, NULL,NULL,NULL);
  fclose (file);
  if (RSA_check_key(&pubKey)==1) {
    printf("la clave publica es correcta\n");
    printf ("La longitud de la clave es de %d bytes\n", RSA_size(&pubKey));
  }
  loadedPub=1;
  return loadedPub;
}


------------------------------------------------------------------
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