Class ReloadingX509TrustManager

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager

    public class ReloadingX509TrustManager
    extends javax.net.ssl.X509ExtendedTrustManager
    implements java.io.Closeable
    A X509ExtendedTrustManager which uses a @FileWatcher to check for changes.
    • Constructor Summary

      Constructors 
      Constructor Description
      ReloadingX509TrustManager​(FileWatcher watcher, java.nio.file.Path path, java.util.function.Function<java.nio.file.Path,​javax.net.ssl.X509ExtendedTrustManager> action)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkClientTrusted​(java.security.cert.X509Certificate[] chain, java.lang.String authType)  
      void checkClientTrusted​(java.security.cert.X509Certificate[] chain, java.lang.String authType, java.net.Socket socket)  
      void checkClientTrusted​(java.security.cert.X509Certificate[] chain, java.lang.String authType, javax.net.ssl.SSLEngine engine)  
      void checkServerTrusted​(java.security.cert.X509Certificate[] chain, java.lang.String authType)  
      void checkServerTrusted​(java.security.cert.X509Certificate[] chain, java.lang.String authType, java.net.Socket socket)  
      void checkServerTrusted​(java.security.cert.X509Certificate[] chain, java.lang.String authType, javax.net.ssl.SSLEngine engine)  
      void close()  
      java.security.cert.X509Certificate[] getAcceptedIssuers()  
      java.time.Instant lastLoaded()  
      • Methods inherited from class java.lang.Object

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

      • ReloadingX509TrustManager

        public ReloadingX509TrustManager​(FileWatcher watcher,
                                         java.nio.file.Path path,
                                         java.util.function.Function<java.nio.file.Path,​javax.net.ssl.X509ExtendedTrustManager> action)
    • Method Detail

      • checkClientTrusted

        public void checkClientTrusted​(java.security.cert.X509Certificate[] chain,
                                       java.lang.String authType)
                                throws java.security.cert.CertificateException
        Specified by:
        checkClientTrusted in interface javax.net.ssl.X509TrustManager
        Throws:
        java.security.cert.CertificateException
      • checkServerTrusted

        public void checkServerTrusted​(java.security.cert.X509Certificate[] chain,
                                       java.lang.String authType)
                                throws java.security.cert.CertificateException
        Specified by:
        checkServerTrusted in interface javax.net.ssl.X509TrustManager
        Throws:
        java.security.cert.CertificateException
      • getAcceptedIssuers

        public java.security.cert.X509Certificate[] getAcceptedIssuers()
        Specified by:
        getAcceptedIssuers in interface javax.net.ssl.X509TrustManager
      • checkClientTrusted

        public void checkClientTrusted​(java.security.cert.X509Certificate[] chain,
                                       java.lang.String authType,
                                       java.net.Socket socket)
                                throws java.security.cert.CertificateException
        Specified by:
        checkClientTrusted in class javax.net.ssl.X509ExtendedTrustManager
        Throws:
        java.security.cert.CertificateException
      • checkServerTrusted

        public void checkServerTrusted​(java.security.cert.X509Certificate[] chain,
                                       java.lang.String authType,
                                       java.net.Socket socket)
                                throws java.security.cert.CertificateException
        Specified by:
        checkServerTrusted in class javax.net.ssl.X509ExtendedTrustManager
        Throws:
        java.security.cert.CertificateException
      • checkClientTrusted

        public void checkClientTrusted​(java.security.cert.X509Certificate[] chain,
                                       java.lang.String authType,
                                       javax.net.ssl.SSLEngine engine)
                                throws java.security.cert.CertificateException
        Specified by:
        checkClientTrusted in class javax.net.ssl.X509ExtendedTrustManager
        Throws:
        java.security.cert.CertificateException
      • checkServerTrusted

        public void checkServerTrusted​(java.security.cert.X509Certificate[] chain,
                                       java.lang.String authType,
                                       javax.net.ssl.SSLEngine engine)
                                throws java.security.cert.CertificateException
        Specified by:
        checkServerTrusted in class javax.net.ssl.X509ExtendedTrustManager
        Throws:
        java.security.cert.CertificateException
      • lastLoaded

        public java.time.Instant lastLoaded()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException