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

public Class CachingPublicKeyAuthenticator

extends AbstractLoggingBean
implements PublickeyAuthenticator
Class Inheritance
All Implemented Interfaces
org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator
Imports
java.security.PublicKey, java.util.Map, .Objects, java.util.concurrent.ConcurrentHashMap, org.apache.sshd.common.AttributeRepository, .RuntimeSshException, org.apache.sshd.common.config.keys.KeyUtils, org.apache.sshd.common.util.logging.AbstractLoggingBean, org.apache.sshd.server.session.ServerSession

Caches the result per session - compensates for OpenSSH behavior where it sends 2 requests with the same key (see SSHD-300).
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
protected final PublickeyAuthenticator
public static final AttributeRepository.AttributeKey<Map<PublicKey, Boolean>>
CACHE_ATTRIBUTE

The AttributeKey used to store the cached authentication results on the session instance

Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
log

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
authenticate(String
the username
username
,
PublicKey
the key
key
,
ServerSession
the server session
session
)

Implements org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator.authenticate.

Check the validity of a public key.

protected Map<PublicKey, Boolean>
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
debugdebugdebugdebugdebugerrorerrorerrorerrorerrorgetSimplifiedLoggerinfoinfowarnwarnwarnwarnwarnwarnwarnwarn

Field Detail

authenticatorback to summary
protected final PublickeyAuthenticator authenticator
CACHE_ATTRIBUTEback to summary
public static final AttributeRepository.AttributeKey<Map<PublicKey, Boolean>> CACHE_ATTRIBUTE

The AttributeKey used to store the cached authentication results on the session instance

Constructor Detail

CachingPublicKeyAuthenticatorback to summary
public CachingPublicKeyAuthenticator(PublickeyAuthenticator authenticator)

Method Detail

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

Implements org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator.authenticate.

Doc from org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator.authenticate.

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

Annotations
@Override
resolveCachedResultsback to summary
protected Map<PublicKey, Boolean> resolveCachedResults(String username, PublicKey key, ServerSession session)