public final class
Helper methods to allow loading and saving of host keys for a computer. Verifiers
don't have a reference to the Node or Computer that they're running for at the point
they're created, so can only load the existing key to run comparisons against at the
point the verifier is invoked during the connection attempt.
Author: Michael Clarke, M Ramon Leon
Methods inherited from class java.lang.
Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
HostKey getHostKey( Computer host)
Retrieve the currently trusted host key for the requested computer, or null if
no key is currently trusted.
host - the Computer to retrieve the key for.
Returns: the currently trusted key for the requested host, or null if no key is trusted.
- if the host key can not be read from storage
public void saveHostKey(
Persists an SSH key to disk for the requested host. This effectively marks
the requested key as trusted for all future connections to the host, until
any future save attempt replaces this key.
host - the host the key is being saved for
hostKey - the key to be saved as the trusted key for this host
- on failure saving the key for the host
Copyright © 2016–2021. All rights reserved.