Difference between trustStore vs keyStore in Java SSL
2017-11-20 00:00
666 查看
http://www.java67.com/2012/12/difference-between-truststore-vs.html
1) Keystore is used to store your credential (server or client) while truststore is used to store others credential (Certificates from CA).
2) Keystore is needed when you are setting up server side on SSL, it is used to store server's identity certificate, which server will present to a client on the connection while trust store setup on client side must contain to make the connection work. If you browser to connect to any website over SSL it verifies certificate presented by server against its truststore.
3) Though I omitted this on the last section to reduce confusion but you can have both keystore and truststore on client and server side if the client also needs to authenticate itself on the server. In this case, client will store its private key and identify certificate on keystore and server will authenticate the client against certificate stored on server's trust store.
4) In Java -javax.net.ssl.keyStore property is used to specify keystore while -javax.net.ssl.trustStore is used to specify trustStore.
5) In Java, one file can represent both keystore vs truststore but it's better to separate private and public credential both for security and maintenance reason.
6 Wn you install JDK or JRE on your machine, Java comes with its own truststore (collection of certificate from well known CA like Verisign, goDaddy, thwarte etc. you can find this file inside
JAVA_HOME/JRE/Security/cacerts where JAVA_HOME is your JDK Installation directory.
7) keytool command (binary comes with JDK installation inside JAVA_HOME/bin) can be used to create and view both keyStore and trustStore.
1) Keystore is used to store your credential (server or client) while truststore is used to store others credential (Certificates from CA).
2) Keystore is needed when you are setting up server side on SSL, it is used to store server's identity certificate, which server will present to a client on the connection while trust store setup on client side must contain to make the connection work. If you browser to connect to any website over SSL it verifies certificate presented by server against its truststore.
3) Though I omitted this on the last section to reduce confusion but you can have both keystore and truststore on client and server side if the client also needs to authenticate itself on the server. In this case, client will store its private key and identify certificate on keystore and server will authenticate the client against certificate stored on server's trust store.
4) In Java -javax.net.ssl.keyStore property is used to specify keystore while -javax.net.ssl.trustStore is used to specify trustStore.
5) In Java, one file can represent both keystore vs truststore but it's better to separate private and public credential both for security and maintenance reason.
6 Wn you install JDK or JRE on your machine, Java comes with its own truststore (collection of certificate from well known CA like Verisign, goDaddy, thwarte etc. you can find this file inside
JAVA_HOME/JRE/Security/cacerts where JAVA_HOME is your JDK Installation directory.
7) keytool command (binary comes with JDK installation inside JAVA_HOME/bin) can be used to create and view both keyStore and trustStore.
相关文章推荐
- How to add or list certificates from keystore or trustStore in Java - Keytool Example Read more: ht
- Difference Between ClassNotFoundException Vs NoClassDefFoundError In Java
- Difference between LinkedList vs ArrayList in Java
- Difference between WeakReference vs SoftReference vs PhantomReference vs Strong reference in Java
- Difference between Set, List and Map in Java - Interview question
- Difference between Association, Composition and Aggregation in Java, UML and Object Oriented Program
- Difference between HashMap, LinkedHashMap and TreeMap in Java
- Difference between Stack and Heap memory in Java
- difference between <? super T> and <? extends T> in Java
- Difference between Enumeration and Iterator in Java
- What’s the difference between an interface and an abstract class in Java?
- Difference between List and Set in Java Collection
- Java - Difference between Wait and Sleep , Yield in Java
- What's the difference between Future and FutureTask in Java?
- Difference between start and run method in Thread – Java Tutorial
- Java - Difference between ArrayList and Vector in Java
- difference between Interface and abstract class in Java
- Difference between <? super T> and <? extends T> in Java
- Difference between ArrayList and Vector in Java
- Difference between ArrayList and LinkedList in Java