Class StaticPublickeyAuthenticator

    • Field Detail

      • acceptance

        private final boolean acceptance
    • Constructor Detail

      • StaticPublickeyAuthenticator

        protected StaticPublickeyAuthenticator​(boolean acceptance)
    • Method Detail

      • isAccepted

        public final boolean isAccepted()
      • authenticate

        public final boolean authenticate​(java.lang.String username,
                                          java.security.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​(java.lang.String username,
                                        java.security.PublicKey key,
                                        ServerSession session)
      • handleRejection

        protected void handleRejection​(java.lang.String username,
                                       java.security.PublicKey key,
                                       ServerSession session)