Top Description Methods
org.apache.sshd.server.auth.pubkey

public Interface PublickeyAuthenticator

Known Direct Implementers
org.apache.sshd.server.auth.pubkey.StaticPublickeyAuthenticator, org.apache.sshd.server.config.keys.AuthorizedKeysAuthenticator, org.apache.sshd.server.auth.pubkey.AuthorizedKeyEntriesPublickeyAuthenticator, org.apache.sshd.server.auth.pubkey.CachingPublicKeyAuthenticator, org.apache.sshd.server.auth.pubkey.KeySetPublickeyAuthenticator
Annotations
@FunctionalInterface
Imports
java.io.IOException, java.security.GeneralSecurityException, .PublicKey, java.util.Collection, org.apache.sshd.common.config.keys.AuthorizedKeyEntry, .PublicKeyEntryResolver, org.apache.sshd.common.util.GenericUtils, org.apache.sshd.server.auth.AsyncAuthException, org.apache.sshd.server.session.ServerSession

The PublickeyAuthenticator is used on the server side to authenticate user public keys.
Author
Apache MINA SSHD Project

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

a boolean indicating if authentication succeeded or not
authenticate
(String
the username
username
,
PublicKey
the key
key
,
ServerSession
the server session
session
)

Check the validity of a public key.

public static PublickeyAuthenticator

Returns:

A wrapper with all the parsed keys
fromAuthorizedEntries
(Object
Some kind of mnemonic identifier for the authenticator - used also in toString()
id
,
ServerSession
The ServerSession that triggered this call - may be null if invoked by offline tool (e.g., unit test) or session context unknown to caller.
session
,
Collection<? extends AuthorizedKeyEntry>
The entries to parse - ignored if null/empty
entries
,
PublicKeyEntryResolver
The public key resolver to use if none of the default registered ones works
fallbackResolver
)

Method Detail

authenticateback to summary
public boolean authenticate(String username, PublicKey key, ServerSession session) throws AsyncAuthException

Check the validity of a public key.

Parameters
username:String

the username

key:PublicKey

the key

session:ServerSession

the server session

Returns:boolean

a boolean indicating if authentication succeeded or not

Exceptions
AsyncAuthException:
If the authentication is performed asynchronously
fromAuthorizedEntriesback to summary
public static PublickeyAuthenticator fromAuthorizedEntries(Object id, ServerSession session, Collection<? extends AuthorizedKeyEntry> entries, PublicKeyEntryResolver fallbackResolver) throws IOException, GeneralSecurityException
Parameters
id:Object

Some kind of mnemonic identifier for the authenticator - used also in toString()

session:ServerSession

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:Collection<? extends AuthorizedKeyEntry>

The entries to parse - ignored if null/empty

fallbackResolver:PublicKeyEntryResolver

The public key resolver to use if none of the default registered ones works

Returns:PublickeyAuthenticator

A wrapper with all the parsed keys

Exceptions
IOException:
If failed to parse the keys data
GeneralSecurityException:
If failed to generate the relevant keys from the parsed data