Interface PublickeyAuthenticator
-
- All Known Implementing Classes:
AcceptAllPublickeyAuthenticator
,AuthorizedKeyEntriesPublickeyAuthenticator
,AuthorizedKeysAuthenticator
,CachingPublicKeyAuthenticator
,DefaultAuthorizedKeysAuthenticator
,KeySetPublickeyAuthenticator
,RejectAllPublickeyAuthenticator
,StaticPublickeyAuthenticator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface PublickeyAuthenticator
ThePublickeyAuthenticator
is used on the server side to authenticate user public keys.- Author:
- Apache MINA SSHD Project
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
authenticate(String username, PublicKey key, ServerSession session)
Check the validity of a public key.static PublickeyAuthenticator
fromAuthorizedEntries(Object id, ServerSession session, Collection<? extends AuthorizedKeyEntry> entries, PublicKeyEntryResolver fallbackResolver)
-
-
-
Method Detail
-
authenticate
boolean authenticate(String username, PublicKey key, ServerSession session) throws AsyncAuthException
Check the validity of a public key.- Parameters:
username
- the usernamekey
- the keysession
- the server session- Returns:
- a boolean indicating if authentication succeeded or not
- Throws:
AsyncAuthException
- If the authentication is performed asynchronously
-
fromAuthorizedEntries
static PublickeyAuthenticator fromAuthorizedEntries(Object id, ServerSession session, Collection<? extends AuthorizedKeyEntry> entries, PublicKeyEntryResolver fallbackResolver) throws IOException, GeneralSecurityException
- Parameters:
id
- Some kind of mnemonic identifier for the authenticator - used also intoString()
session
- TheServerSession
that triggered this call - may benull
if invoked by offline tool (e.g., unit test) or session context unknown to caller.entries
- The entries to parse - ignored ifnull
/emptyfallbackResolver
- The public key resolver to use if none of the default registered ones works- Returns:
- A wrapper with all the parsed keys
- Throws:
IOException
- If failed to parse the keys dataGeneralSecurityException
- If failed to generate the relevant keys from the parsed data
-
-