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 theServerKeyVerifierfrom Apache MINA sshd and ourServerKeyDatabase.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classJGitServerKeyVerifier.SessionConfig
-
Field Summary
Fields Modifier and Type Field Description private ServerKeyDatabasedatabaseprivate static org.slf4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description JGitServerKeyVerifier(ServerKeyDatabase database)Creates a newJGitServerKeyVerifierusing 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.booleanverifyServerKey(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 newJGitServerKeyVerifierusing 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: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, java.net.SocketAddress remoteAddress, java.security.PublicKey serverKey)- Specified by:
verifyServerKeyin interfaceorg.apache.sshd.client.keyverifier.ServerKeyVerifier
-
-