aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/ServerKeyLookup.java
blob: 4adea6e84b128465b85df74bda5326295a2876dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright (C) 2018, Thomas Wolf <thomas.wolf@paranor.ch> and others
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
package org.eclipse.jgit.internal.transport.sshd;

import java.net.SocketAddress;
import java.security.PublicKey;
import java.util.List;

import org.apache.sshd.client.session.ClientSession;
import org.eclipse.jgit.annotations.NonNull;

/**
 * Offers operations to retrieve server keys from known_hosts files.
 */
public interface ServerKeyLookup {

	/**
	 * Retrieves all public keys known for a given remote.
	 *
	 * @param session
	 *            needed to determine the config files if specified in the ssh
	 *            config
	 * @param remote
	 *            to find entries for
	 * @return a possibly empty list of entries found, including revoked ones
	 */
	@NonNull
	List<PublicKey> lookup(ClientSession session, SocketAddress remote);
}