Keystore vs truststore — reprint

Original text: http://lukejin.iteye.com/blog/605634

Today, a colleague asked me about these two concepts, so I recorded them. First, we have to clarify some concepts. If a web application needs to provide services accessed by HTTPS, we need a digital certificate. The certificate is configured in the configuration file of Apache or the configuration file of other web containers. Of course, this can be saved in the keystore.

The keystore or truststore commonly referred to in our own applications is mainly aimed at the needs of the application itself. Keystore and truststore are actually the same thing in terms of their file format. They are just separated for management convenience. Our private key is generally saved in keystore for encryption and decryption or signing for others

Truststore is required. If we do not specify it explicitly, Java will specify $Java by default_ Home / lib / security / cacerts this file.

If you want to specify it, you can specify it in the parameters of Java

< div id = "" class = "DP highlighter" > < div class = "bar" > < div class = "tools" > java code < a title = "collect this code" >

 favorite code

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>