Class KeySetPublickeyAuthenticator
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.server.auth.pubkey.KeySetPublickeyAuthenticator
-
- All Implemented Interfaces:
PublickeyAuthenticator
public class KeySetPublickeyAuthenticator extends AbstractLoggingBean implements PublickeyAuthenticator
Checks against aCollectionofPublicKeys
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Objectidprivate java.util.Collection<? extends java.security.PublicKey>keySet-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description KeySetPublickeyAuthenticator(java.lang.Object id, java.util.Collection<? extends java.security.PublicKey> keySet)
-
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.booleanauthenticate(java.lang.String username, java.security.PublicKey key, ServerSession session, java.util.Collection<? extends java.security.PublicKey> keys)java.lang.ObjectgetId()java.util.Collection<? extends java.security.PublicKey>getKeySet()java.lang.StringtoString()
-
-
-
Method Detail
-
getId
public java.lang.Object getId()
- Returns:
- Some kind of mnemonic identifier for the authenticator - used also in
toString()
-
getKeySet
public final java.util.Collection<? extends java.security.PublicKey> getKeySet()
-
authenticate
public 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
-
authenticate
public boolean authenticate(java.lang.String username, java.security.PublicKey key, ServerSession session, java.util.Collection<? extends java.security.PublicKey> keys)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-