Class TrustManagerBuilder


  • public class TrustManagerBuilder
    extends java.lang.Object
    Builder for a trust manager with custom certificates.
    • Constructor Detail

      • TrustManagerBuilder

        public TrustManagerBuilder()
    • Method Detail

      • addBuiltinCertificates

        public TrustManagerBuilder addBuiltinCertificates()
                                                   throws java.lang.Exception
        Add certificates from the default trust store
        Returns:
        this
        Throws:
        java.lang.Exception - In case anything explodes.
      • addFromResourceDirectory

        public TrustManagerBuilder addFromResourceDirectory​(java.lang.String path)
                                                     throws java.lang.Exception
        Add certificates from the specified resource directory, using {path}/bundled.txt and {path}/extended.txt as the list of JKS file names to laoad from that directory.
        Parameters:
        path - Path to the resource directory.
        Returns:
        this
        Throws:
        java.lang.Exception - In case anything explodes.
      • build

        public javax.net.ssl.X509TrustManager build()
                                             throws java.lang.Exception
        Returns:
        A trust manager with the loaded certificates.
        Throws:
        java.lang.Exception - In case anything explodes.