Class KeySetPublickeyAuthenticator

java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.server.auth.pubkey.KeySetPublickeyAuthenticator
All Implemented Interfaces:
PublickeyAuthenticator

public class KeySetPublickeyAuthenticator extends AbstractLoggingBean implements PublickeyAuthenticator
Checks against a Collection of PublicKeys
  • Constructor Details

  • Method Details

    • getId

      public Object getId()
      Returns:
      Some kind of mnemonic identifier for the authenticator - used also in toString()
    • getKeySet

      public final Collection<? extends PublicKey> getKeySet()
    • authenticate

      public boolean authenticate(String username, PublicKey key, ServerSession session)
      Description copied from interface: PublickeyAuthenticator
      Checks whether the given PublicKey is allowed to be used for authenticating user "username" in a session.

      Note that the key may be a OpenSshCertificate. A typical implementation for a certificate would check that the certificate's CA key is known to be trusted as a certificate authority, and that the given user name is listed in the certificate's principals.

      Specified by:
      authenticate in interface PublickeyAuthenticator
      Parameters:
      username - the username
      key - the key
      session - the server session
      Returns:
      true if the key may be used; false otherwise
    • authenticate

      public boolean authenticate(String username, PublicKey key, ServerSession session, Collection<? extends PublicKey> keys)
    • toString

      public String toString()
      Overrides:
      toString in class Object