Class KnownHostHashValue
java.lang.Object
org.apache.sshd.client.config.hosts.KnownHostHashValue
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NamedFactory
<Mac> private NamedFactory
<Mac> private byte[]
static final char
Character used to indicate a hashed host patternprivate byte[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <A extends Appendable>
Aappend
(A sb, KnownHostHashValue hashValue) static <A extends Appendable>
Aappend
(A sb, NamedResource factory, byte[] salt, byte[] digest) static <A extends Appendable>
AappendHostPattern
(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) byte[]
byte[]
boolean
isHostMatch
(String host, int port) Checks if the host matches the hashstatic KnownHostHashValue
static <V extends KnownHostHashValue>
Vvoid
setDigester
(NamedFactory<Mac> digester) void
setDigestValue
(byte[] digestValue) void
setSaltValue
(byte[] saltValue) toString()
-
Field Details
-
HASHED_HOST_DELIMITER
public static final char HASHED_HOST_DELIMITERCharacter used to indicate a hashed host pattern- See Also:
-
DEFAULT_DIGEST
-
digester
-
saltValue
private byte[] saltValue -
digestValue
private byte[] digestValue
-
-
Constructor Details
-
KnownHostHashValue
public KnownHostHashValue()
-
-
Method Details
-
getDigester
-
setDigester
-
getSaltValue
public byte[] getSaltValue() -
setSaltValue
public void setSaltValue(byte[] saltValue) -
getDigestValue
public byte[] getDigestValue() -
setDigestValue
public void setDigestValue(byte[] digestValue) -
isHostMatch
Checks if the host matches the hash- Parameters:
host
- The host name/address - ignored ifnull
/emptyport
- The access port - ignored if non-positive or SSH default- Returns:
true
if host matches the hash- Throws:
RuntimeException
- If entry not properly initialized
-
toString
-
calculateHashValue
public static byte[] calculateHashValue(String host, int port, Factory<? extends Mac> factory, byte[] salt) throws Exception - Throws:
Exception
-
calculateHashValue
public static byte[] calculateHashValue(String host, int port, Mac mac, byte[] salt) throws Exception - Throws:
Exception
-
createHostPattern
-
appendHostPattern
public static <A extends Appendable> A appendHostPattern(A sb, String host, int port) throws IOException - Throws:
IOException
-
append
public static <A extends Appendable> A append(A sb, KnownHostHashValue hashValue) throws IOException - Throws:
IOException
-
append
public static <A extends Appendable> A append(A sb, NamedResource factory, byte[] salt, byte[] digest) throws IOException - Throws:
IOException
-
parse
-
parse
-