You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ServerKeyLookup.java 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  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. import java.net.SocketAddress;
  12. import java.security.PublicKey;
  13. import java.util.List;
  14. import org.apache.sshd.client.session.ClientSession;
  15. import org.eclipse.jgit.annotations.NonNull;
  16. /**
  17. * Offers operations to retrieve server keys from known_hosts files.
  18. */
  19. public interface ServerKeyLookup {
  20. /**
  21. * Retrieves all public keys known for a given remote.
  22. *
  23. * @param session
  24. * needed to determine the config files if specified in the ssh
  25. * config
  26. * @param remote
  27. * to find entries for
  28. * @return a possibly empty list of entries found, including revoked ones
  29. */
  30. @NonNull
  31. List<PublicKey> lookup(ClientSession session, SocketAddress remote);
  32. }