| java.lang.Object |
| ↳ |
net.schmizz.sshj.transport.verification.OpenSSHKnownHosts |
Known Direct Subclasses
|
Class Overview
A HostKeyVerifier implementation for a known_hosts file i.e. in the format used by OpenSSH.
Summary
| Nested Classes |
|
class |
OpenSSHKnownHosts.AbstractEntry |
|
|
class |
OpenSSHKnownHosts.CommentEntry |
|
|
class |
OpenSSHKnownHosts.EntryFactory |
Each line in these files contains the following fields: markers
(optional), hostnames, bits, exponent, modulus, comment. |
|
class |
OpenSSHKnownHosts.HashedEntry |
|
|
interface |
OpenSSHKnownHosts.HostEntry |
|
|
enum |
OpenSSHKnownHosts.Marker |
|
|
class |
OpenSSHKnownHosts.SimpleEntry |
|
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
From interface
net.schmizz.sshj.transport.verification.HostKeyVerifier
|
abstract
boolean
|
verify(String hostname, int port, PublicKey key)
This callback is invoked when the server's host key needs to be verified.
|
|
Fields
private
static
final
Logger
LOG
private
static
final
String
LS
protected
final
File
khFile
protected
final
Logger
log
Public Constructors
public
OpenSSHKnownHosts
(File khFile)
Public Methods
public
static
File
detectSSHDir
()
public
boolean
verify
(String hostname, int port, PublicKey key)
This callback is invoked when the server's host key needs to be verified. The return value indicates to the
caller whether the SSH connection should proceed.
Note: host key verification is the basis for security in SSH, therefore exercise due caution in
implementing!
Parameters
| hostname
| Remote hostname |
| port
| Remote port |
| key
| Host key of server |
Returns
true if key is acceptable, false otherwise
Protected Methods
protected
boolean
hostKeyUnverifiableAction
(String hostname, PublicKey key)