public class KnownHostHashValue extends Object
| Modifier and Type | Field and Description |
|---|---|
static NamedFactory<Mac> |
DEFAULT_DIGEST |
static char |
HASHED_HOST_DELIMITER
Character used to indicate a hashed host pattern
|
| Constructor and Description |
|---|
KnownHostHashValue() |
| Modifier and Type | Method and Description |
|---|---|
static <A extends Appendable> |
append(A sb,
KnownHostHashValue hashValue) |
static <A extends Appendable> |
append(A sb,
NamedResource factory,
byte[] salt,
byte[] digest) |
static <A extends Appendable> |
appendHostPattern(A sb,
String host,
int port) |
static byte[] |
calculateHashValue(String host,
int port,
Factory<? extends Mac> factory,
byte[] salt) |
static byte[] |
calculateHashValue(String host,
int port,
Mac mac,
byte[] salt) |
static String |
createHostPattern(String host,
int port) |
NamedFactory<Mac> |
getDigester() |
byte[] |
getDigestValue() |
byte[] |
getSaltValue() |
boolean |
isHostMatch(String host,
int port)
Checks if the host matches the hash
|
static KnownHostHashValue |
parse(String patternString) |
static <V extends KnownHostHashValue> |
parse(String patternString,
V value) |
void |
setDigester(NamedFactory<Mac> digester) |
void |
setDigestValue(byte[] digestValue) |
void |
setSaltValue(byte[] saltValue) |
String |
toString() |
public static final char HASHED_HOST_DELIMITER
public static final NamedFactory<Mac> DEFAULT_DIGEST
public NamedFactory<Mac> getDigester()
public void setDigester(NamedFactory<Mac> digester)
public byte[] getSaltValue()
public void setSaltValue(byte[] saltValue)
public byte[] getDigestValue()
public void setDigestValue(byte[] digestValue)
public boolean isHostMatch(String host, int port)
host - The host name/address - ignored if null/emptyport - The access port - ignored if non-positive or SSH defaulttrue if host matches the hashRuntimeException - If entry not properly initializedpublic static byte[] calculateHashValue(String host, int port, Factory<? extends Mac> factory, byte[] salt) throws Exception
Exceptionpublic static byte[] calculateHashValue(String host, int port, Mac mac, byte[] salt) throws Exception
Exceptionpublic static <A extends Appendable> A appendHostPattern(A sb, String host, int port) throws IOException
IOExceptionpublic static <A extends Appendable> A append(A sb, KnownHostHashValue hashValue) throws IOException
IOExceptionpublic static <A extends Appendable> A append(A sb, NamedResource factory, byte[] salt, byte[] digest) throws IOException
IOExceptionpublic static KnownHostHashValue parse(String patternString)
public static <V extends KnownHostHashValue> V parse(String patternString, V value)
Copyright © 2018–2021 The Apache Software Foundation. All rights reserved.