51 views

How to print the Public Key of a Certificate using Keytool


 

To print the Public Key of a Certificate, do the following :

  • From System Definition < Certificate (sys_certificate table), find the required certificate and download the attachment. Save it locally in your system.

Public Key of a cetificate

 

  •  Run the command line below from the location you have saved the previous attachment:

    e.g. snca:~/Downloads$ keytool -list -rfc -keystore saml2sp_keystore -alias saml2sp -storepass saml2sp
    Please set the keystore name, alias and store password to the correct values accordingly


    It will return information of the Public key of the certificate gets displayed as below :
 
 
Alias name: saml2sp
Creation date: Apr 3, 2012
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
-----BEGIN CERTIFICATE-----
MIIB6TCCAVKgAwIBAgIET3twvTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJV
UzEMMAoGA1UEChMDU05DMQwwCgYDVQQLEwNEZXYxDjAMBgNVBAMTBVNBTUwyMB4X
DTEyMDQwMzIxNTA1M1oXDTIyMDQwMTIxNTA1M1owOTELMAkGA1UEBhMCVVMxDDAK
BgNVBAoTA1NOQzEMMAoGA1UECxMDRGV2MQ4wDAYDVQQDEwVTQU1MMjCBnzANBgkq
hkiG9w0BAQEFAAOBjQAwgYkCgYEAuYIDRhSA6HrPvb4GjSvOXJqbKal3GpbzqORe
Vos0NRvNgILFTgp+gJbeKL7vAXlKDdVxS6JpZSNJmGVdQtJm9NHt8y8URJHgt6/D
6tybk5NSoAnfp2IK/Gne2md4dJ4w+aemErvcmyQW1TFnHD1kqbxd1atNttnmVEPh
MIJZmmkCAwEAATANBgkqhkiG9w0BAQUFAAOBgQAweyhbwOErpTPitOZUiQgpUfm6
YPpr6IOMOcnPfWYg0wQHMeKq/MmAdv5fcbp+qUfx3pQBOwIdk5Gfw47QIcKP9jYP
Quir8l6toXahtmVvY8O6EKG5tIrYXX1kmW+QQeQguclDMYl3u8u7+101PehkiLxJ
j53BwUaSn30D6Ol8aA==
-----END CERTIFICATE-----

 

 

Article Information

Last Updated:2018-10-08 11:27:28
Published:2018-10-03