Class StaticPublickeyAuthenticator

java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.server.auth.pubkey.StaticPublickeyAuthenticator
All Implemented Interfaces:
PublickeyAuthenticator
Direct Known Subclasses:
AcceptAllPublickeyAuthenticator, RejectAllPublickeyAuthenticator

public abstract class StaticPublickeyAuthenticator extends AbstractLoggingBean implements PublickeyAuthenticator
Returns the same constant result true/false regardless
  • Constructor Details

    • StaticPublickeyAuthenticator

      protected StaticPublickeyAuthenticator(boolean acceptance)
  • Method Details

    • isAccepted

      public final boolean isAccepted()
    • authenticate

      public final 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
    • handleAcceptance

      protected void handleAcceptance(String username, PublicKey key, ServerSession session)
    • handleRejection

      protected void handleRejection(String username, PublicKey key, ServerSession session)