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 theServerKeyVerifier
from Apache MINA sshd and ourServerKeyDatabase
.
-
-
Constructor Summary
Constructors Constructor Description JGitServerKeyVerifier(ServerKeyDatabase database)
Creates a newJGitServerKeyVerifier
using the givenServerKeyDatabase
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<PublicKey>
lookup(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)
-
-
-
Constructor Detail
-
JGitServerKeyVerifier
public JGitServerKeyVerifier(@NonNull ServerKeyDatabase database)
Creates a newJGitServerKeyVerifier
using the givenServerKeyDatabase
.- Parameters:
database
- to use
-
-
Method Detail
-
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
-
-