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/falseregardless
-
-
Field Summary
Fields Modifier and Type Field Description private booleanacceptance-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedStaticPublickeyAuthenticator(boolean acceptance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanauthenticate(java.lang.String username, java.security.PublicKey key, ServerSession session)Checks whether the givenPublicKeyis allowed to be used for authenticating user "username" in a session.protected voidhandleAcceptance(java.lang.String username, java.security.PublicKey key, ServerSession session)protected voidhandleRejection(java.lang.String username, java.security.PublicKey key, ServerSession session)booleanisAccepted()
-
-
-
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:PublickeyAuthenticatorChecks whether the givenPublicKeyis allowed to be used for authenticating user "username" in a session.Note that the
keymay be aOpenSshCertificate. A typical implementation for a certificate would check that the certificate's CA key is known to be trusted as a certificate authority, and that the given user name is listed in the certificate's principals.- Specified by:
authenticatein interfacePublickeyAuthenticator- Parameters:
username- the usernamekey- the keysession- the server session- Returns:
trueif the key may be used;falseotherwise
-
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)
-
-