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 java.lang.Object implements org.apache.sshd.client.keyverifier.ServerKeyVerifier, ServerKeyLookup
A bridge between theServerKeyVerifier
from Apache MINA sshd and ourServerKeyDatabase
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
JGitServerKeyVerifier.SessionConfig
-
Field Summary
Fields Modifier and Type Field Description private ServerKeyDatabase
database
private static org.slf4j.Logger
LOG
-
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 java.util.List<java.security.PublicKey>
lookup(org.apache.sshd.client.session.ClientSession session, java.net.SocketAddress remoteAddress)
Retrieves all public keys known for a given remote.boolean
verifyServerKey(org.apache.sshd.client.session.ClientSession session, java.net.SocketAddress remoteAddress, java.security.PublicKey serverKey)
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
database
@NonNull private final ServerKeyDatabase database
-
-
Constructor Detail
-
JGitServerKeyVerifier
public JGitServerKeyVerifier(@NonNull ServerKeyDatabase database)
Creates a newJGitServerKeyVerifier
using the givenServerKeyDatabase
.- Parameters:
database
- to use
-
-
Method Detail
-
lookup
public java.util.List<java.security.PublicKey> lookup(org.apache.sshd.client.session.ClientSession session, java.net.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, java.net.SocketAddress remoteAddress, java.security.PublicKey serverKey)
- Specified by:
verifyServerKey
in interfaceorg.apache.sshd.client.keyverifier.ServerKeyVerifier
-
-