Class ReloadingX509KeyManager

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, javax.net.ssl.KeyManager, javax.net.ssl.X509KeyManager

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String chooseClientAlias​(java.lang.String[] keyType, java.security.Principal[] issuers, java.net.Socket socket)  
      java.lang.String chooseEngineClientAlias​(java.lang.String[] keyType, java.security.Principal[] issuers, javax.net.ssl.SSLEngine engine)  
      java.lang.String chooseEngineServerAlias​(java.lang.String keyType, java.security.Principal[] issuers, javax.net.ssl.SSLEngine engine)  
      java.lang.String chooseServerAlias​(java.lang.String keyType, java.security.Principal[] issuers, java.net.Socket socket)  
      void close()  
      java.security.cert.X509Certificate[] getCertificateChain​(java.lang.String alias)  
      java.lang.String[] getClientAliases​(java.lang.String keyType, java.security.Principal[] issuers)  
      java.security.PrivateKey getPrivateKey​(java.lang.String alias)  
      java.lang.String[] getServerAliases​(java.lang.String keyType, java.security.Principal[] issuers)  
      java.time.Instant lastLoaded()  
      • Methods inherited from class java.lang.Object

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

      • ReloadingX509KeyManager

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

      • getClientAliases

        public java.lang.String[] getClientAliases​(java.lang.String keyType,
                                                   java.security.Principal[] issuers)
        Specified by:
        getClientAliases in interface javax.net.ssl.X509KeyManager
      • chooseClientAlias

        public java.lang.String chooseClientAlias​(java.lang.String[] keyType,
                                                  java.security.Principal[] issuers,
                                                  java.net.Socket socket)
        Specified by:
        chooseClientAlias in interface javax.net.ssl.X509KeyManager
      • getServerAliases

        public java.lang.String[] getServerAliases​(java.lang.String keyType,
                                                   java.security.Principal[] issuers)
        Specified by:
        getServerAliases in interface javax.net.ssl.X509KeyManager
      • chooseServerAlias

        public java.lang.String chooseServerAlias​(java.lang.String keyType,
                                                  java.security.Principal[] issuers,
                                                  java.net.Socket socket)
        Specified by:
        chooseServerAlias in interface javax.net.ssl.X509KeyManager
      • getCertificateChain

        public java.security.cert.X509Certificate[] getCertificateChain​(java.lang.String alias)
        Specified by:
        getCertificateChain in interface javax.net.ssl.X509KeyManager
      • getPrivateKey

        public java.security.PrivateKey getPrivateKey​(java.lang.String alias)
        Specified by:
        getPrivateKey in interface javax.net.ssl.X509KeyManager
      • chooseEngineClientAlias

        public java.lang.String chooseEngineClientAlias​(java.lang.String[] keyType,
                                                        java.security.Principal[] issuers,
                                                        javax.net.ssl.SSLEngine engine)
        Overrides:
        chooseEngineClientAlias in class javax.net.ssl.X509ExtendedKeyManager
      • chooseEngineServerAlias

        public java.lang.String chooseEngineServerAlias​(java.lang.String keyType,
                                                        java.security.Principal[] issuers,
                                                        javax.net.ssl.SSLEngine engine)
        Overrides:
        chooseEngineServerAlias in class javax.net.ssl.X509ExtendedKeyManager
      • 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