1 /* 2 * Copyright (C) 2018, Thomas Wolf <thomas.wolf@paranor.ch> and others 3 * 4 * This program and the accompanying materials are made available under the 5 * terms of the Eclipse Distribution License v. 1.0 which is available at 6 * https://www.eclipse.org/org/documents/edl-v10.php. 7 * 8 * SPDX-License-Identifier: BSD-3-Clause 9 */ 10 package org.eclipse.jgit.internal.transport.sshd; 11 12 import java.net.SocketAddress; 13 import java.security.PublicKey; 14 import java.util.List; 15 16 import org.apache.sshd.client.session.ClientSession; 17 import org.eclipse.jgit.annotations.NonNull; 18 19 /** 20 * Offers operations to retrieve server keys from known_hosts files. 21 */ 22 public interface ServerKeyLookup { 23 24 /** 25 * Retrieves all public keys known for a given remote. 26 * 27 * @param session 28 * needed to determine the config files if specified in the ssh 29 * config 30 * @param remote 31 * to find entries for 32 * @return a possibly empty list of entries found, including revoked ones 33 */ 34 @NonNull 35 List<PublicKey> lookup(ClientSession session, SocketAddress remote); 36 }