public class DefaultKnownHostsServerKeyVerifier extends KnownHostsServerKeyVerifier
~/.ssh/known_hosts file of the user currently running
the client, updating and re-loading it if necessary. It also (optionally)
enforces the same permissions regime as OpenSSH.KnownHostsServerKeyVerifier.HostEntryPair| Modifier and Type | Field and Description |
|---|---|
private boolean |
strict |
KNOWN_HOSTS_FILE_OPTION, STRICT_CHECKING_OPTION, updateLockoptions, STRICTLY_PROHIBITED_FILE_PERMISSIONlog| Constructor and Description |
|---|
DefaultKnownHostsServerKeyVerifier(ServerKeyVerifier delegate) |
DefaultKnownHostsServerKeyVerifier(ServerKeyVerifier delegate,
boolean strict) |
DefaultKnownHostsServerKeyVerifier(ServerKeyVerifier delegate,
boolean strict,
java.io.File file) |
DefaultKnownHostsServerKeyVerifier(ServerKeyVerifier delegate,
boolean strict,
java.nio.file.Path file,
java.nio.file.LinkOption... options) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isStrict() |
protected java.util.List<KnownHostsServerKeyVerifier.HostEntryPair> |
reloadKnownHosts(ClientSession session,
java.nio.file.Path file) |
acceptIncompleteHostKeys, acceptKnownHostEntries, acceptKnownHostEntry, acceptModifiedServerKey, acceptUnknownHostKey, findKnownHostEntry, getDelegateVerifier, getFallbackPublicKeyEntryResolver, getHostValueDigester, getLoadedHostsEntries, getModifiedServerKeyAcceptor, handleKnownHostsFileUpdateFailure, handleModifiedServerKeyUpdateFailure, prepareKnownHostEntry, prepareModifiedServerKeyLine, resolveHostKey, resolveHostNetworkIdentities, setLoadedHostsEntries, setModifiedServerKeyAcceptor, updateKnownHostsFile, updateModifiedServerKey, verifyServerKeycheckReloadRequired, exists, getPath, lastModified, resetReloadAttributes, size, toPathResource, toPathResource, toString, updateReloadAttributes, validateStrictConfigFilePermissionsgetSimplifiedLoggerpublic DefaultKnownHostsServerKeyVerifier(ServerKeyVerifier delegate)
public DefaultKnownHostsServerKeyVerifier(ServerKeyVerifier delegate, boolean strict)
public DefaultKnownHostsServerKeyVerifier(ServerKeyVerifier delegate, boolean strict, java.io.File file)
public DefaultKnownHostsServerKeyVerifier(ServerKeyVerifier delegate, boolean strict, java.nio.file.Path file, java.nio.file.LinkOption... options)
public final boolean isStrict()
true then makes sure that the containing folder
has 0700 access and the file 0644. Note: for Windows it
does not check these permissionsModifiableFileWatcher.validateStrictConfigFilePermissions(Path, LinkOption...)protected java.util.List<KnownHostsServerKeyVerifier.HostEntryPair> reloadKnownHosts(ClientSession session, java.nio.file.Path file) throws java.io.IOException, java.security.GeneralSecurityException
reloadKnownHosts in class KnownHostsServerKeyVerifiersession - The ClientSession that triggered this requestfile - The Path to reload fromList of the loaded KnownHostsServerKeyVerifier.HostEntryPairs - may be null/emptyjava.io.IOException - If failed to parse the filejava.security.GeneralSecurityException - If failed to resolve the encoded public keys