Hello,

Thank's for the answer, but i still got a little problem, when i run this code :

EVP_PKEY *key2 = X509_get_pubkey(certif.getX509Certificate());
cout << BN_bn2hex(key2->pkey.rsa->n);

I miss the first 00 of the public key...
How can i get them ?



[EMAIL PROTECTED] wrote:
Hello,

[EMAIL PROTECTED] wrote on 04/15/2008 06:30:10 PM:

Hello,

I'm looking to get back the public key from a x509 v3 certificate.

I use the function ASN1_BIT_STRING * key = 509_get0_pubkey_bitstr(x509* certificate); but i don't get what i want : I get (from a conversion to hexadecimal thanks to : cout << setw(2) <<

setfill('0') << right << hex << (int) key->data[c]; )
30:82:01:0A:02:82:01:01:___the_public_key___:02:03:01:00:01

How can i get only the public key ?
Try X509_get_pubkey().

Best regards,
--
Marek Marcola <[EMAIL PROTECTED]>

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



Reply via email to