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 ServerKeyDatabase
private static final org.slf4j.Logger
-
Constructor Summary
ConstructorsConstructorDescriptionJGitServerKeyVerifier
(ServerKeyDatabase database) Creates a newJGitServerKeyVerifier
using 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.boolean
verifyServerKey
(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 newJGitServerKeyVerifier
using 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:ServerKeyLookup
Retrieves all public keys known for a given remote.- Specified by:
lookup
in 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:
verifyServerKey
in interfaceorg.apache.sshd.client.keyverifier.ServerKeyVerifier
-