Class JGitServerKeyVerifier
java.lang.Object
org.eclipse.jgit.internal.transport.sshd.JGitServerKeyVerifier
- All Implemented Interfaces:
org.apache.sshd.client.keyverifier.ServerKeyVerifier,ServerKeyLookup
public class JGitServerKeyVerifier
extends Object
implements org.apache.sshd.client.keyverifier.ServerKeyVerifier, ServerKeyLookup
A bridge between the
ServerKeyVerifier from Apache MINA sshd and our
ServerKeyDatabase.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ServerKeyDatabaseprivate static final org.slf4j.Logger -
Constructor Summary
ConstructorsConstructorDescriptionJGitServerKeyVerifier(ServerKeyDatabase database) Creates a newJGitServerKeyVerifierusing the givenServerKeyDatabase. -
Method Summary
Modifier and TypeMethodDescriptionlookup(org.apache.sshd.client.session.ClientSession session, SocketAddress remoteAddress) Retrieves all public keys known for a given remote.booleanverifyServerKey(org.apache.sshd.client.session.ClientSession session, SocketAddress remoteAddress, PublicKey serverKey)
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
database
-
-
Constructor Details
-
JGitServerKeyVerifier
Creates a newJGitServerKeyVerifierusing the givenServerKeyDatabase.- Parameters:
database- to use
-
-
Method Details
-
lookup
public List<PublicKey> lookup(org.apache.sshd.client.session.ClientSession session, SocketAddress remoteAddress) Description copied from interface:ServerKeyLookupRetrieves all public keys known for a given remote.- Specified by:
lookupin interfaceServerKeyLookup- Parameters:
session- needed to determine the config files if specified in the ssh configremoteAddress- to find entries for- Returns:
- a possibly empty list of entries found, including revoked ones
-
verifyServerKey
public boolean verifyServerKey(org.apache.sshd.client.session.ClientSession session, SocketAddress remoteAddress, PublicKey serverKey) - Specified by:
verifyServerKeyin interfaceorg.apache.sshd.client.keyverifier.ServerKeyVerifier
-