Class RequiredServerKeyVerifier

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.security.PublicKey requiredKey  
    • Constructor Summary

      Constructors 
      Constructor Description
      RequiredServerKeyVerifier​(java.security.PublicKey requiredKey)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.security.PublicKey getRequiredKey()  
      boolean verifyServerKey​(ClientSession sshClientSession, java.net.SocketAddress remoteAddress, java.security.PublicKey serverKey)
      Verify that the server key provided is really the one of the host.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • requiredKey

        private final java.security.PublicKey requiredKey
    • Constructor Detail

      • RequiredServerKeyVerifier

        public RequiredServerKeyVerifier​(java.security.PublicKey requiredKey)
    • Method Detail

      • getRequiredKey

        public final java.security.PublicKey getRequiredKey()
      • verifyServerKey

        public boolean verifyServerKey​(ClientSession sshClientSession,
                                       java.net.SocketAddress remoteAddress,
                                       java.security.PublicKey serverKey)
        Description copied from interface: ServerKeyVerifier
        Verify that the server key provided is really the one of the host.
        Specified by:
        verifyServerKey in interface ServerKeyVerifier
        Parameters:
        sshClientSession - the current ClientSession
        remoteAddress - the host's SocketAddress
        serverKey - the presented server PublicKey
        Returns:
        true if the key is accepted for the host