Top Fields Constructors Methods
org.apache.sshd.client.config.hosts

public Class KnownHostHashValue

extends Object
Class Inheritance
Imports
java.io.IOException, .UncheckedIOException, java.nio.charset.StandardCharsets, java.util.Arrays, .Base64, .Objects, org.apache.sshd.common.Factory, .NamedFactory, .NamedResource, .RuntimeSshException, .SshConstants, org.apache.sshd.common.mac.Mac, org.apache.sshd.common.util.GenericUtils, .NumberUtils, .ValidateUtils, org.apache.sshd.common.util.buffer.BufferUtils

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final NamedFactory<Mac>
private NamedFactory<Mac>
private byte[]
public static final char
HASHED_HOST_DELIMITER

Character used to indicate a hashed host pattern

private byte[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static <A extends Appendable> A
append(A sb, KnownHostHashValue hashValue)

public static <A extends Appendable> A
append(A sb, NamedResource factory, byte[] salt, byte[] digest)

public static <A extends Appendable> A
appendHostPattern(A sb, String host, int port)

public static byte[]
calculateHashValue(String host, int port, Factory<? extends Mac> factory, byte[] salt)

public static byte[]
calculateHashValue(String host, int port, Mac mac, byte[] salt)

public static String
createHostPattern(String host, int port)

public NamedFactory<Mac>
public byte[]
public byte[]
public boolean

Returns:

true if host matches the hash
isHostMatch
(String
The host name/address - ignored if null/empty
host
,
int
The access port - ignored if non-positive or SSH default
port
)

Checks if the host matches the hash

public static KnownHostHashValue
parse(String patternString)

public static <V extends KnownHostHashValue> V
parse(String patternString, V value)

public void
public void
setDigestValue(byte[] digestValue)

public void
setSaltValue(byte[] saltValue)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

DEFAULT_DIGESTback to summary
public static final NamedFactory<Mac> DEFAULT_DIGEST
digesterback to summary
private NamedFactory<Mac> digester
digestValueback to summary
private byte[] digestValue
HASHED_HOST_DELIMITERback to summary
public static final char HASHED_HOST_DELIMITER

Character used to indicate a hashed host pattern

saltValueback to summary
private byte[] saltValue

Constructor Detail

KnownHostHashValueback to summary
public KnownHostHashValue()

Method Detail

appendback to summary
public static <A extends Appendable> A append(A sb, KnownHostHashValue hashValue) throws IOException
appendback to summary
public static <A extends Appendable> A append(A sb, NamedResource factory, byte[] salt, byte[] digest) throws IOException
appendHostPatternback to summary
public static <A extends Appendable> A appendHostPattern(A sb, String host, int port) throws IOException
calculateHashValueback to summary
public static byte[] calculateHashValue(String host, int port, Factory<? extends Mac> factory, byte[] salt) throws Exception
calculateHashValueback to summary
public static byte[] calculateHashValue(String host, int port, Mac mac, byte[] salt) throws Exception
createHostPatternback to summary
public static String createHostPattern(String host, int port)
getDigesterback to summary
public NamedFactory<Mac> getDigester()
getDigestValueback to summary
public byte[] getDigestValue()
getSaltValueback to summary
public byte[] getSaltValue()
isHostMatchback to summary
public boolean isHostMatch(String host, int port)

Checks if the host matches the hash

Parameters
host:String

The host name/address - ignored if null/empty

port:int

The access port - ignored if non-positive or SSH default

Returns:boolean

true if host matches the hash

Exceptions
RuntimeException:
If entry not properly initialized
parseback to summary
public static KnownHostHashValue parse(String patternString)
parseback to summary
public static <V extends KnownHostHashValue> V parse(String patternString, V value)
setDigesterback to summary
public void setDigester(NamedFactory<Mac> digester)
setDigestValueback to summary
public void setDigestValue(byte[] digestValue)
setSaltValueback to summary
public void setSaltValue(byte[] saltValue)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override