Class SslHelper


  • public class SslHelper
    extends java.lang.Object
    Need bouncycastle libs. This libs are not in the jar. implementation group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.76' implementation group: 'org.bouncycastle', name: 'bcpkix-jdk18on', version: '1.76' implementation group: 'org.bouncycastle', name: 'bcutil-jdk18on', version: '1.76'
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.security.KeyStore createKeystore​(java.lang.String password, java.security.cert.X509Certificate cert, java.security.PrivateKey key)  
      static java.lang.String getDefaultCharSet()  
      static javax.net.ssl.SSLContext getSSLContext​(java.lang.String caCrtString, java.lang.String certificateString, java.lang.String privateKeyString, java.lang.String keystorePassword)  
      static javax.net.ssl.SSLContext getSSLContext​(java.nio.file.Path caCrtFile, java.nio.file.Path crtFile, java.nio.file.Path keyFile, java.lang.String password)  
      • Methods inherited from class java.lang.Object

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

      • createKeystore

        public static java.security.KeyStore createKeystore​(java.lang.String password,
                                                            java.security.cert.X509Certificate cert,
                                                            java.security.PrivateKey key)
                                                     throws java.security.KeyStoreException,
                                                            java.io.IOException,
                                                            java.security.NoSuchAlgorithmException,
                                                            java.security.cert.CertificateException
        Throws:
        java.security.KeyStoreException
        java.io.IOException
        java.security.NoSuchAlgorithmException
        java.security.cert.CertificateException
      • getDefaultCharSet

        public static java.lang.String getDefaultCharSet()
      • getSSLContext

        public static javax.net.ssl.SSLContext getSSLContext​(java.nio.file.Path caCrtFile,
                                                             java.nio.file.Path crtFile,
                                                             java.nio.file.Path keyFile,
                                                             java.lang.String password)
                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getSSLContext

        public static javax.net.ssl.SSLContext getSSLContext​(java.lang.String caCrtString,
                                                             java.lang.String certificateString,
                                                             java.lang.String privateKeyString,
                                                             java.lang.String keystorePassword)
                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception