Check out example codes for "java self signed certificate truststore". It will help you in understanding the concepts better.

Code Example 1

<JAVA_HOME>\bin\keytool -import -v -trustcacerts
-alias server-alias -file server.cer
-keystore cacerts.jks -keypass changeit
-storepass changeit

Learn ReactJs, React Native from akashmittal.com