Class StaticServerKeyVerifier
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.client.keyverifier.StaticServerKeyVerifier
- All Implemented Interfaces:
ServerKeyVerifier
- Direct Known Subclasses:
AcceptAllServerKeyVerifier
,RejectAllServerKeyVerifier
public abstract class StaticServerKeyVerifier
extends AbstractLoggingBean
implements ServerKeyVerifier
Returns the same constant answer
true/false
regardless- Author:
- Apache MINA SSHD Project
-
Field Summary
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
handleAcceptance
(ClientSession sshClientSession, SocketAddress remoteAddress, PublicKey serverKey) protected void
handleRejection
(ClientSession sshClientSession, SocketAddress remoteAddress, PublicKey serverKey) final boolean
final boolean
verifyServerKey
(ClientSession sshClientSession, SocketAddress remoteAddress, PublicKey serverKey) Verify that the server key provided is really the one of the host.
-
Constructor Details
-
StaticServerKeyVerifier
protected StaticServerKeyVerifier(boolean acceptance)
-
-
Method Details
-
isAccepted
public final boolean isAccepted() -
verifyServerKey
public final boolean verifyServerKey(ClientSession sshClientSession, SocketAddress remoteAddress, PublicKey serverKey) Description copied from interface:ServerKeyVerifier
Verify that the server key provided is really the one of the host.- Specified by:
verifyServerKey
in interfaceServerKeyVerifier
- Parameters:
sshClientSession
- the currentClientSession
remoteAddress
- the host'sSocketAddress
serverKey
- the presented serverPublicKey
- Returns:
true
if the key is accepted for the host
-
handleAcceptance
protected void handleAcceptance(ClientSession sshClientSession, SocketAddress remoteAddress, PublicKey serverKey) -
handleRejection
protected void handleRejection(ClientSession sshClientSession, SocketAddress remoteAddress, PublicKey serverKey)
-