On 11/02/13 14:12, Jeffrey Walton wrote: > Hi All, > > I'm trying to extract a public key (subjectPublicKeyInfo) form an X509 > certificate. > > Should I look for the subjectPublicKeyInfo in X509_EXTENSION_get_object? > > What is the easiest (or recommended) way? > > Jeff > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > User Support Mailing List openssl-users@openssl.org > Automated List Manager majord...@openssl.org > >
from apps/x509.c in the openssl source: x=load_cert(bio_err,infile,informat,NULL,e,"Certificate"); ... EVP_PKEY *pkey; pkey=X509_get_pubkey(x); if (pkey == NULL) { BIO_printf(bio_err,"Error getting public key\n"); ERR_print_errors(bio_err); goto end; } PEM_write_bio_PUBKEY(STDout, pkey); ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org