Class AuthorizedKeyEntriesPublickeyAuthenticator
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.server.auth.pubkey.AuthorizedKeyEntriesPublickeyAuthenticator
-
- All Implemented Interfaces:
PublickeyAuthenticator
public class AuthorizedKeyEntriesPublickeyAuthenticator extends AbstractLoggingBean implements PublickeyAuthenticator
Checks against aCollection
ofAuthorizedKeyEntry
s Records the matched entry under a session attribute.
-
-
Field Summary
Fields Modifier and Type Field Description static AttributeRepository.AttributeKey<AuthorizedKeyEntry>
AUTHORIZED_KEY
private java.lang.Object
id
private java.util.Map<AuthorizedKeyEntry,java.security.PublicKey>
resolvedKeys
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description AuthorizedKeyEntriesPublickeyAuthenticator(java.lang.Object id, ServerSession session, java.util.Collection<? extends AuthorizedKeyEntry> entries, PublicKeyEntryResolver fallbackResolver)
-
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.java.lang.Object
getId()
java.lang.String
toString()
-
-
-
Field Detail
-
AUTHORIZED_KEY
public static final AttributeRepository.AttributeKey<AuthorizedKeyEntry> AUTHORIZED_KEY
-
resolvedKeys
private java.util.Map<AuthorizedKeyEntry,java.security.PublicKey> resolvedKeys
-
id
private java.lang.Object id
-
-
Constructor Detail
-
AuthorizedKeyEntriesPublickeyAuthenticator
public AuthorizedKeyEntriesPublickeyAuthenticator(java.lang.Object id, ServerSession session, java.util.Collection<? extends AuthorizedKeyEntry> entries, PublicKeyEntryResolver fallbackResolver) throws java.io.IOException, java.security.GeneralSecurityException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
-
-
Method Detail
-
getId
public java.lang.Object getId()
- Returns:
- Some kind of mnemonic identifier for the authenticator - used also in
toString()
-
authenticate
public 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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-