public class FileWatcherKeyPairResourceLoader extends ModifiableFileWatcher implements KeyPairResourceLoader
KeyPair
-s an re-loads it whenever a change has been sensed in the monitored file (if
it exists)Modifier and Type | Field and Description |
---|---|
private KeyPairResourceLoader |
delegateLoader |
protected java.util.concurrent.atomic.AtomicReference<java.util.Collection<java.security.KeyPair>> |
keysHolder |
options, STRICTLY_PROHIBITED_FILE_PERMISSION
log
EMPTY, MAX_CIPHER_NAME_LENGTH, MAX_KEY_COMMENT_LENGTH, MAX_KEY_TYPE_NAME_LENGTH, MAX_PRIVATE_KEY_DATA_SIZE, MAX_PUBLIC_KEY_DATA_SIZE
Constructor and Description |
---|
FileWatcherKeyPairResourceLoader(java.nio.file.Path file,
KeyPairResourceLoader delegateLoader) |
FileWatcherKeyPairResourceLoader(java.nio.file.Path file,
KeyPairResourceLoader delegateLoader,
java.nio.file.LinkOption... options) |
Modifier and Type | Method and Description |
---|---|
KeyPairResourceLoader |
getKeyPairResourceLoader() |
java.util.Collection<java.security.KeyPair> |
loadKeyPairs(SessionContext session,
NamedResource resourceKey,
FilePasswordProvider passwordProvider,
java.util.List<java.lang.String> lines)
Loads key pairs from the given resource text lines
|
protected java.util.Collection<java.security.KeyPair> |
reloadKeyPairs(SessionContext session,
NamedResource resourceKey,
FilePasswordProvider passwordProvider,
java.util.List<java.lang.String> lines) |
void |
setKeyPairResourceLoader(KeyPairResourceLoader loader) |
checkReloadRequired, exists, getPath, lastModified, resetReloadAttributes, size, toPathResource, toPathResource, toString, updateReloadAttributes, validateStrictConfigFilePermissions
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs
protected final java.util.concurrent.atomic.AtomicReference<java.util.Collection<java.security.KeyPair>> keysHolder
private KeyPairResourceLoader delegateLoader
public FileWatcherKeyPairResourceLoader(java.nio.file.Path file, KeyPairResourceLoader delegateLoader)
public FileWatcherKeyPairResourceLoader(java.nio.file.Path file, KeyPairResourceLoader delegateLoader, java.nio.file.LinkOption... options)
public KeyPairResourceLoader getKeyPairResourceLoader()
public void setKeyPairResourceLoader(KeyPairResourceLoader loader)
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
KeyPairResourceLoader
loadKeyPairs
in interface KeyPairResourceLoader
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 linespasswordProvider
- The FilePasswordProvider
to use in case the data is encrypted - may be
null
if no encrypted data is expectedlines
- The List
of lines as read from the resourceKeyPair
s - 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 itjava.io.IOException
- If failed to process the linesjava.security.GeneralSecurityException
- If failed to generate the keys from the parsed dataprotected 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
java.io.IOException
java.security.GeneralSecurityException