public class AuthorizedKeysAuthenticator extends ModifiableFileWatcher implements PublickeyAuthenticator
PublickeyAuthenticator
while automatically re-loading the keys if the file has changed when a
new authentication request is received. Note: by default, the only
validation of the username is that it is not null/empty - see
isValidUsername(String, ServerSession)optionslog| Constructor and Description |
|---|
AuthorizedKeysAuthenticator(File file) |
AuthorizedKeysAuthenticator(Path file) |
AuthorizedKeysAuthenticator(Path file,
LinkOption... options) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticate(String username,
PublicKey key,
ServerSession session)
Check the validity of a public key.
|
protected boolean |
isValidUsername(String username,
ServerSession session) |
protected Collection<AuthorizedKeyEntry> |
reloadAuthorizedKeys(Path path,
String username,
ServerSession session) |
protected PublickeyAuthenticator |
resolvePublickeyAuthenticator(String username,
ServerSession session) |
checkReloadRequired, exists, getPath, lastModified, resetReloadAttributes, size, updateReloadAttributespublic AuthorizedKeysAuthenticator(File file)
public AuthorizedKeysAuthenticator(Path file)
public AuthorizedKeysAuthenticator(Path file, LinkOption... options)
public boolean authenticate(String username, PublicKey key, ServerSession session)
PublickeyAuthenticatorauthenticate in interface PublickeyAuthenticatorusername - the usernamekey - the keysession - the server sessionprotected boolean isValidUsername(String username, ServerSession session)
protected PublickeyAuthenticator resolvePublickeyAuthenticator(String username, ServerSession session) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionprotected Collection<AuthorizedKeyEntry> reloadAuthorizedKeys(Path path, String username, ServerSession session) throws IOException
IOExceptionCopyright © 2008–2015 The Apache Software Foundation. All rights reserved.