Class KnownHostHashValue

    • Field Detail

      • HASHED_HOST_DELIMITER

        public static final char HASHED_HOST_DELIMITER
        Character used to indicate a hashed host pattern
        See Also:
        Constant Field Values
    • Constructor Detail

      • KnownHostHashValue

        public KnownHostHashValue()
    • Method Detail

      • getSaltValue

        public byte[] getSaltValue()
      • setSaltValue

        public void setSaltValue​(byte[] saltValue)
      • getDigestValue

        public byte[] getDigestValue()
      • setDigestValue

        public void setDigestValue​(byte[] digestValue)
      • isHostMatch

        public boolean isHostMatch​(String host,
                                   int port)
        Checks if the host matches the hash
        Parameters:
        host - The host name/address - ignored if null/empty
        port - The access port - ignored if non-positive or SSH default
        Returns:
        true if host matches the hash
        Throws:
        RuntimeException - If entry not properly initialized
      • 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

        public static String createHostPattern​(String host,
                                               int port)