Extract of Public key and Serial number from Certificate

2012-02-20 Thread praveenpvs
Hi, I am new to OPENSSL. I have a certificate, i need to extract public key and serial number from it. I know the command to do that, but i wanted to use api in my application. Command to get the public key from the certificate: openssl x509 -inform pem -in -pubkey -noout > Command to get th

Re: Extract of Public key and Serial number from Certificate

2012-02-21 Thread praveenpvs
= X509_get_pubkey(x509); iRetVal = PEM_write_PUBKEY(fp, PubKey); printf("The return value of PEM_write_PUBKEY is %d \n", iRetVal); free(fp); return iRetVal; } Thank you very much Dr. Stephen Henson wrote: > > On Mon, Feb 20, 2012, Dave Thompson wro

Re: Extract of Public key and Serial number from Certificate

2012-02-21 Thread praveenpvs
I am having some problem with the following piece of code.. When I extracted the public key and saved to file, the Public key file looks like: -BEGIN PUBLIC KEY- MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQCcKeojdze5WBip9ZT5GzNu6gcg X/Vw4hftCDIQ5TQ6DHDxKxBfapCgKx/4tIgomsm3P9Q6JjhxOZjv/zOvlmQDt

RE: Extract of Public key and Serial number from Certificate

2012-02-22 Thread praveenpvs
Thanks Dave.. With fclose() it is working fine :) Thank you very much for your inputs...I shall follow them Dave Thompson-5 wrote: > >> From: owner-openssl-us...@openssl.org On Behalf Of praveenpvs >> Sent: Tuesday, 21 February, 2012 10:24 > >> When I extracted the

Usage of d2i_RSA_PUBKEY function!!

2012-11-16 Thread PraveenPVS
Hi, I need to load RSA Public key which is stored in the char buffer. I came across d2i_RSA_PUBKEY function to do the same (Please correct me if I am wrong here). When I use this function, RSA Public key is not getting loaded. In the main, i have the following function call: loadRSAPubKey("MIIB