com.jscape.inet.ssh.util

## Class HostKeyFingerprintVerifier

- java.lang.Object
- - com.jscape.inet.ssh.util.HostKeyFingerprintVerifier

- All Implemented Interfaces:
    HostKeyVerificationService

      public class HostKeyFingerprintVerifier
      extends java.lang.Object
      implements HostKeyVerificationService

  Host key verifier implementation based on the `SshHostKeys` usage.

  Methods of this class are not thread-safe.

  All methods throw `NullPointerException` if some object parameter is `null` and `IllegalArgumentException` if some parameter doesn't correspond to the method contract.
  Author:
    Alex

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.jscape.inet.ssh.protocol.v2.transport.keyexchange.HostKeyVerificationService

      `HostKeyVerificationService.InvalidHostKeyException, HostKeyVerificationService.OperationException`

  - ### Field Summary

    - ### Fields inherited from interface com.jscape.inet.ssh.protocol.v2.transport.keyexchange.HostKeyVerificationService

      `NULL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HostKeyFingerprintVerifier(SshHostKeys knownKeys)` Creates a new verifier instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assertKeyValid(java.net.InetAddress host, java.security.PublicKey key)` Checks if specified key is valid.
    `SshHostKeys` | `getKnownKeys()` Returns allowed host keys.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### HostKeyFingerprintVerifier

          public HostKeyFingerprintVerifier(SshHostKeys knownKeys)

      Creates a new verifier instance.
      Parameters:
        `knownKeys` - allowed host keys

  - ### Method Detail

    - #### getKnownKeys

          public SshHostKeys getKnownKeys()

      Returns allowed host keys.
      Returns:
        allowed host keys

    - #### assertKeyValid

          public void assertKeyValid(java.net.InetAddress host,
                                     java.security.PublicKey key)
                              throws HostKeyVerificationService.OperationException

      Description copied from interface: `HostKeyVerificationService`
      Checks if specified key is valid.
      Specified by:
        `assertKeyValid` in interface `HostKeyVerificationService`
      Parameters:
        `host` - a server host
        `key` - a server key
      Throws:
        `HostKeyVerificationService.OperationException` - if an error occurs

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © JSCAPE LLC. 1999-2021. All Rights Reserved