public class JGitServerKeyVerifier extends java.lang.Object implements org.apache.sshd.client.keyverifier.ServerKeyVerifier, ServerKeyLookup
ServerKeyVerifier
from Apache MINA sshd and our
ServerKeyDatabase
.Modifier and Type | Class and Description |
---|---|
private static class |
JGitServerKeyVerifier.SessionConfig |
Modifier and Type | Field and Description |
---|---|
private ServerKeyDatabase |
database |
private static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
JGitServerKeyVerifier(ServerKeyDatabase database)
Creates a new
JGitServerKeyVerifier using the given
ServerKeyDatabase . |
Modifier and Type | Method and 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) |
private static final org.slf4j.Logger LOG
@NonNull private final ServerKeyDatabase database
public JGitServerKeyVerifier(@NonNull ServerKeyDatabase database)
JGitServerKeyVerifier
using the given
ServerKeyDatabase
.database
- to usepublic java.util.List<java.security.PublicKey> lookup(org.apache.sshd.client.session.ClientSession session, java.net.SocketAddress remoteAddress)
ServerKeyLookup
lookup
in interface ServerKeyLookup
session
- needed to determine the config files if specified in the ssh
configremoteAddress
- to find entries forpublic boolean verifyServerKey(org.apache.sshd.client.session.ClientSession session, java.net.SocketAddress remoteAddress, java.security.PublicKey serverKey)
verifyServerKey
in interface org.apache.sshd.client.keyverifier.ServerKeyVerifier