Class CheckCertificate


  • public class CheckCertificate
    extends java.lang.Object
    Class used to add the server's certificate to the KeyStore with your trusted certificates.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int CheckCertStore​(java.lang.String host, int port, java.lang.String targetKeyStore, java.lang.String keyStorePwd)  
      private static void findClosestMatchTrustedCert​(java.security.KeyStore ks, java.security.cert.X509Certificate rootCert)  
      private static java.lang.String getDNField​(java.lang.String dnFld, java.lang.String dn)  
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CheckCertificate

        public CheckCertificate()
    • Method Detail

      • CheckCertStore

        public static int CheckCertStore​(java.lang.String host,
                                         int port,
                                         java.lang.String targetKeyStore,
                                         java.lang.String keyStorePwd)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • findClosestMatchTrustedCert

        private static void findClosestMatchTrustedCert​(java.security.KeyStore ks,
                                                        java.security.cert.X509Certificate rootCert)
      • getDNField

        private static java.lang.String getDNField​(java.lang.String dnFld,
                                                   java.lang.String dn)
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception