Class FileWatcherKeyPairResourceLoader

    • Field Detail

      • keysHolder

        protected final java.util.concurrent.atomic.AtomicReference<java.util.Collection<java.security.KeyPair>> keysHolder
    • Constructor Detail

      • FileWatcherKeyPairResourceLoader

        public FileWatcherKeyPairResourceLoader​(java.nio.file.Path file,
                                                KeyPairResourceLoader delegateLoader)
      • FileWatcherKeyPairResourceLoader

        public FileWatcherKeyPairResourceLoader​(java.nio.file.Path file,
                                                KeyPairResourceLoader delegateLoader,
                                                java.nio.file.LinkOption... options)
    • Method Detail

      • loadKeyPairs

        public java.util.Collection<java.security.KeyPair> loadKeyPairs​(SessionContext session,
                                                                        NamedResource resourceKey,
                                                                        FilePasswordProvider passwordProvider,
                                                                        java.util.List<java.lang.String> lines)
                                                                 throws java.io.IOException,
                                                                        java.security.GeneralSecurityException
        Description copied from interface: KeyPairResourceLoader
        Loads key pairs from the given resource text lines
        Specified by:
        loadKeyPairs in interface KeyPairResourceLoader
        Parameters:
        session - The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool or session unknown).
        resourceKey - A hint as to the origin of the text lines
        passwordProvider - The FilePasswordProvider to use in case the data is encrypted - may be null if no encrypted data is expected
        lines - The List of lines as read from the resource
        Returns:
        The extracted KeyPairs - may be null/empty if none. Note: the resource loader may decide to skip unknown lines if more than one key pair type is encoded in it
        Throws:
        java.io.IOException - If failed to process the lines
        java.security.GeneralSecurityException - If failed to generate the keys from the parsed data
      • reloadKeyPairs

        protected java.util.Collection<java.security.KeyPair> reloadKeyPairs​(SessionContext session,
                                                                             NamedResource resourceKey,
                                                                             FilePasswordProvider passwordProvider,
                                                                             java.util.List<java.lang.String> lines)
                                                                      throws java.io.IOException,
                                                                             java.security.GeneralSecurityException
        Throws:
        java.io.IOException
        java.security.GeneralSecurityException