Class StaticPublickeyAuthenticator
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.server.auth.pubkey.StaticPublickeyAuthenticator
-
- All Implemented Interfaces:
PublickeyAuthenticator
- Direct Known Subclasses:
AcceptAllPublickeyAuthenticator
,RejectAllPublickeyAuthenticator
public abstract class StaticPublickeyAuthenticator extends AbstractLoggingBean implements PublickeyAuthenticator
Returns the same constant resulttrue/false
regardless
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
acceptance
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
StaticPublickeyAuthenticator(boolean acceptance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authenticate(java.lang.String username, java.security.PublicKey key, ServerSession session)
Check the validity of a public key.protected void
handleAcceptance(java.lang.String username, java.security.PublicKey key, ServerSession session)
protected void
handleRejection(java.lang.String username, java.security.PublicKey key, ServerSession session)
boolean
isAccepted()
-
-
-
Method Detail
-
isAccepted
public final boolean isAccepted()
-
authenticate
public final boolean authenticate(java.lang.String username, java.security.PublicKey key, ServerSession session)
Description copied from interface:PublickeyAuthenticator
Check the validity of a public key.- Specified by:
authenticate
in interfacePublickeyAuthenticator
- Parameters:
username
- the usernamekey
- the keysession
- the server session- Returns:
- a boolean indicating if authentication succeeded or not
-
handleAcceptance
protected void handleAcceptance(java.lang.String username, java.security.PublicKey key, ServerSession session)
-
handleRejection
protected void handleRejection(java.lang.String username, java.security.PublicKey key, ServerSession session)
-
-