public class KnownHostEntry extends HostPatternsHolder
known_hosts file| Modifier and Type | Field and Description |
|---|---|
static char |
MARKER_INDICATOR
Character that denotes that start of a marker
|
static String |
STD_HOSTS_FILENAME
Standard OpenSSH config file name
|
ALL_HOSTS_PATTERN, NEGATION_CHAR_PATTERN, NON_STANDARD_PORT_PATTERN_ENCLOSURE_END_DELIM, NON_STANDARD_PORT_PATTERN_ENCLOSURE_START_DELIM, PATTERN_CHARS, PORT_VALUE_DELIMITER, SINGLE_CHAR_PATTERN, WILDCARD_PATTERN| Constructor and Description |
|---|
KnownHostEntry() |
KnownHostEntry(String line) |
findMatchingEntries, findMatchingEntries, getPatterns, isHostMatch, isHostMatch, isSpecificHostPattern, isValidPatternChar, parsePatterns, parsePatterns, setPatterns, toPatternpublic static final char MARKER_INDICATOR
public static final String STD_HOSTS_FILENAME
public KnownHostEntry()
public KnownHostEntry(String line)
line - The original line from which this entry was createdpublic String getConfigLine()
public void setConfigLine(String line)
public String getMarker()
public void setMarker(String marker)
public AuthorizedKeyEntry getKeyEntry()
public void setKeyEntry(AuthorizedKeyEntry keyEntry)
public KnownHostHashValue getHashedEntry()
public void setHashedEntry(KnownHostHashValue hashedEntry)
public boolean isHostMatch(String host, int port)
HostPatternsHolderisHostMatch in class HostPatternsHolderhost - The host name / address - ignored if null/emptyport - The connection porttrue if the name / address matches the pattern(s)HostPatternsHolder.isHostMatch(String, Pattern)public static Path getDefaultKnownHostsFile()
Path location of the OpenSSH known hosts filepublic static List<KnownHostEntry> readKnownHostEntries(Path path, OpenOption... options) throws IOException
IOExceptionpublic static List<KnownHostEntry> readKnownHostEntries(URL url) throws IOException
IOExceptionpublic static List<KnownHostEntry> readKnownHostEntries(InputStream inStream, boolean okToClose) throws IOException
IOExceptionpublic static List<KnownHostEntry> readKnownHostEntries(Reader rdr, boolean okToClose) throws IOException
IOExceptionpublic static List<KnownHostEntry> readKnownHostEntries(BufferedReader rdr) throws IOException
rdr - The BufferedReader to useList of read KnownHostEntry-iesIOException - If failed to parse the read configurationpublic static KnownHostEntry parseKnownHostEntry(String line)
public static <E extends KnownHostEntry> E parseKnownHostEntry(E entry, String data)
Copyright © 2018–2020 The Apache Software Foundation. All rights reserved.