Class AuthorizedKeyEntriesPublickeyAuthenticator

    • Constructor Detail

      • AuthorizedKeyEntriesPublickeyAuthenticator

        public AuthorizedKeyEntriesPublickeyAuthenticator​(java.lang.Object id,
                                                          ServerSession session,
                                                          java.util.Collection<? extends AuthorizedKeyEntry> entries,
                                                          PublicKeyEntryResolver fallbackResolver)
                                                   throws java.io.IOException,
                                                          java.security.GeneralSecurityException
        Throws:
        java.io.IOException
        java.security.GeneralSecurityException
    • Method Detail

      • getId

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

        public 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object