How to print the public key of a certificate using keytool?

You can do it with: keytool -list -rfc -keystore mykeystore.jks -alias certificate_alias -storepass password Example run: PS c:\sample> keytool -list -rfc -keystore mykeystore.jks -alias cert_alias -storepass password Alias name: cert_alias Creation date: Apr 25, 2014 Entry type: PrivateKeyEntry Certificate chain length: 1 Certificate[1]: —–BEGIN CERTIFICATE—– MIIB4zCCAUygAwIBAgIIRzI14w7rL20wDQYJKoZIhvcNAQENBQAwMzELMAkGA1UEBhMCVVMxDTAL BgNVBAoTBE5vbmUxFTATBgNVBAMTDE5vbmUgb3U9Tm9uZTAgFw0xNDA0MjQxNzQ0NDJaGA8yMTE0 MDQyNTE3NDQ0MlowMzELMAkGA1UEBhMCVVMxDTALBgNVBAoTBE5vbmUxFTATBgNVBAMTDE5vbmUg b3U9Tm9uZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAivXBBtFnJTm1NbHysv3Mnpn/lCg6 1onJDxr/jkvI8+1Bljs1jktyYOeKDWxJwpDU7QyIqttgtDvRT4Yaew5WiQyADIyY0cBTvp3S7uKx M5C3zxZdG6WTflU7xcYnGk3/d0VhwA6BL9YPsRaS/K+ww1yvxWKIOPW68wDe0ccvGWcCAwEAATAN BgkqhkiG9w0BAQ0FAAOBgQB/5qDMA9fmlCWlOD9aHjBD6I8zAOSshMCFK8XcZJHowag8WtZyL3DR insx2HoDlBewIJAEtAplo2NpeFyNtK93PS7zV+vwEYHCu46Db3klMksp3MmSXD39QPlmwfsGZlja K8Ww0TsR5GtccFMH41KKa+PlvVZNEdZumdrca59olQ== —–END … Read more

How to add certificate chain to keystore?

I solved the problem by cat’ing all the pems together: cat cert.pem chain.pem fullchain.pem >all.pem openssl pkcs12 -export -in all.pem -inkey privkey.pem -out cert_and_key.p12 -name tomcat -CAfile chain.pem -caname root -password MYPASSWORD keytool -importkeystore -deststorepass MYPASSWORD -destkeypass MYPASSWORD -destkeystore MyDSKeyStore.jks -srckeystore cert_and_key.p12 -srcstoretype PKCS12 -srcstorepass MYPASSWORD -alias tomcat keytool -import -trustcacerts -alias root -file chain.pem … Read more

Tomcat Server/Client Self-Signed SSL Certificate

Finally got the solution to my problem, so I’ll post the results here if anyone else gets stuck. Thanks to Michael Martin of Michael’s Software Thoughts & Ramblings I discovered that: keytool by default uses the DSA algorithm when generating the self-signed cert. Earlier versions of Firefox accepted these keys without problem. With Firefox 3 … Read more

How to generate 11 char hash key for Sms Retriever with Google App signing

Here is the complete step by step guide . Go to play console -> open app -> Release management -> App Signing -> Download Certificate . Like in below screen shot This will give you deployment_cert.der file Convert the deployment_cert.der file to a .jks file use below command keytool -importcert -alias YOUR_ALIAS -file deployment_cert.der -keystore … Read more

while importing a certificate with keytool , Why to use trustcacerts option

When you import a certificate other than a self-signed root certificate (e.g. intermediate certificates), keytool tries to build and validate a proper certificate path first. If you use the trustcacerts parameter, then for building the path, keytool will not only consider the certificates already contained in the trust store, but it will additionally consider the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)