Interface PublickeyAuthenticator

    • Method Detail

      • authenticate

        boolean authenticate​(java.lang.String username,
                             java.security.PublicKey key,
                             ServerSession session)
                      throws AsyncAuthException
        Check the validity of a public key.
        Parameters:
        username - the username
        key - the key
        session - the server session
        Returns:
        a boolean indicating if authentication succeeded or not
        Throws:
        AsyncAuthException - If the authentication is performed asynchronously
      • fromAuthorizedEntries

        static PublickeyAuthenticator fromAuthorizedEntries​(java.lang.Object id,
                                                            ServerSession session,
                                                            java.util.Collection<? extends AuthorizedKeyEntry> entries,
                                                            PublicKeyEntryResolver fallbackResolver)
                                                     throws java.io.IOException,
                                                            java.security.GeneralSecurityException
        Parameters:
        id - Some kind of mnemonic identifier for the authenticator - used also in toString()
        session - The ServerSession that triggered this call - may be null if invoked by offline tool (e.g., unit test) or session context unknown to caller.
        entries - The entries to parse - ignored if null/empty
        fallbackResolver - The public key resolver to use if none of the default registered ones works
        Returns:
        A wrapper with all the parsed keys
        Throws:
        java.io.IOException - If failed to parse the keys data
        java.security.GeneralSecurityException - If failed to generate the relevant keys from the parsed data