Bonjour,

Hodie XIV Kal. Iun. MMIX, naveen.bn scripsit:
> I have used this command to obtain public key in hex but,  how to get  
> the individual value of public key ( n,e).
> openssl x509 -modulus -noout -inform PEM <  
> /home/certificates/MTA/MTA_DEVICE.cert.pem | sed s/Modulus=/0x/
> 0xC147647398B19BBC59CD2CEC49B8774E0025AC9161955CE5F9C6E2DCA8D026D04565F400C489379E48737DCDBCBD86F669B5796070259885D7603B54102E9D93FE8708E2BF46003BD53F671DF73CF9FA288D03BFA3E09E37F8D606F8F6AA5672DE2E386C818BFB93FF2111612EABA7663BD5745CB8FC27286A46EF498E4996388931FACEECDFDE7B283DF809B00784FA980E40FFE665FB0558C4C14BC93E58DF75444774644FB03EC90E7D42E794C1A0306FCAD3C2E1360E517E2B94ED0E61BAB4C4A90098AD33AC1F760CFDC58F1B238C04C68F3E893208E4771BC65D6A7B522014360BAD9BDC8AC88D88C492B6191D559B555552F6A1E302181846BDC70BCF

In fact, you asked for the modulus (n), and that's what you obtained.
To get the entire public key, including the public exponent (e), use this:
openssl x509 -pubkey -noout -in /home/certificates/MTA/MTA_DEVICE.cert.pem | 
openssl rsa -noout -text -pubin

Then, do whatever is necessary to convert this output in something
useful for you.

-- 
Erwann ABALEA <[email protected]>
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [email protected]

Reply via email to