@FunctionalInterface
public interface PublickeyAuthenticator
PublickeyAuthenticator is used on the server side
to authenticate user public keys.| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticate(java.lang.String username,
java.security.PublicKey key,
ServerSession session)
Check the validity of a public key.
|
static PublickeyAuthenticator |
fromAuthorizedEntries(java.lang.Object id,
ServerSession session,
java.util.Collection<? extends AuthorizedKeyEntry> entries,
PublicKeyEntryResolver fallbackResolver) |
boolean authenticate(java.lang.String username,
java.security.PublicKey key,
ServerSession session)
throws AsyncAuthException
username - the usernamekey - the keysession - the server sessionAsyncAuthException - If the authentication is performed asynchronouslystatic PublickeyAuthenticator fromAuthorizedEntries(java.lang.Object id, ServerSession session, java.util.Collection<? extends AuthorizedKeyEntry> entries, PublicKeyEntryResolver fallbackResolver) throws java.io.IOException, java.security.GeneralSecurityException
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/emptyfallbackResolver - The public key resolver to use if none of the default registered ones worksjava.io.IOException - If failed to parse the keys datajava.security.GeneralSecurityException - If failed to generate the relevant keys from the parsed data