get a cert from a keystore

Tue, Nov 29, 2005

To export the X509 Certificate containing the public key for a private key with the alias “guanxi” in the keystore “guanxi_idp.jks”:

keytool -keystore ./guanxi_idp.jks -export -rfc -alias guanxi -file cert.crt

This will give you a certificate like this:

—–BEGIN CERTIFICATE—– MIIDcjCCAtugAwIBAgIDIQ36MA0GCSqGSIb3DQEBBAUAMIHOMQswCQYDVQQGEwJaQTEVMBMGA1UE CBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xHTAbBgNVBAoTFFRoYXd0ZSBDb25z … … 4bOGviXuKBE/0e+QVSuGwCDQetJYVz368HYAHorFLwik3BdKl3NlmlWQTipsOV97OboDqbDeuLhv L5ek1CWI8Fgid3bI0SILno8V/ZBoXyuHSx7Tv5WxKA== —–END CERTIFICATE—–

comments powered by Disqus