Class RequiredServerKeyVerifier
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.client.keyverifier.RequiredServerKeyVerifier
-
- All Implemented Interfaces:
ServerKeyVerifier
public class RequiredServerKeyVerifier extends AbstractLoggingBean implements ServerKeyVerifier
A ServerKeyVerifier that accepts one server key (specified in the constructor)
-
-
Field Summary
Fields Modifier and Type Field Description private java.security.PublicKey
requiredKey
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description RequiredServerKeyVerifier(java.security.PublicKey requiredKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.PublicKey
getRequiredKey()
boolean
verifyServerKey(ClientSession sshClientSession, java.net.SocketAddress remoteAddress, java.security.PublicKey serverKey)
Verify that the server key provided is really the one of the host.-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
getSimplifiedLogger
-
-
-
-
Method Detail
-
getRequiredKey
public final java.security.PublicKey getRequiredKey()
-
verifyServerKey
public boolean verifyServerKey(ClientSession sshClientSession, java.net.SocketAddress remoteAddress, java.security.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
-
-