public class AuthorizedKeysPublicKeyAuthenticationProvider extends AbstractPublicKeyAuthenticationProvider
This class implements the OpenSSH style authorized_keys public key store.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
authorizedKeysFile
The path relative to the users home directory from which to load
authorized keys
|
| Constructor and Description |
|---|
AuthorizedKeysPublicKeyAuthenticationProvider()
Create a default authorized_keys store that reads keys from
.ssh/authorized_keys.
|
AuthorizedKeysPublicKeyAuthenticationProvider(java.lang.String authorizedKeysFile)
Create an authorized keys stores that reads keys from a custom location.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(SshPublicKey key,
java.lang.String comment,
SshConnection con) |
boolean |
checkKey(SshPublicKey key,
SshConnection con) |
protected AbstractFile |
getFile(SshConnection con) |
java.util.Iterator<SshPublicKeyFile> |
getKeys(SshConnection con) |
boolean |
isAuthorizedKey(SshPublicKey key,
SshConnection con)
Checks the given public key by comparing it against the public keys
stored in the users authorized_keys file.
|
void |
remove(SshPublicKey key,
SshConnection con) |
getNameprotected java.lang.String authorizedKeysFile
public AuthorizedKeysPublicKeyAuthenticationProvider()
public AuthorizedKeysPublicKeyAuthenticationProvider(java.lang.String authorizedKeysFile)
authorizedKeysFile - Stringpublic boolean isAuthorizedKey(SshPublicKey key, SshConnection con)
key - SshPublicKeysessionid - byte[]authenticationProvider - AuthenticationProviderpublic void add(SshPublicKey key, java.lang.String comment, SshConnection con) throws java.io.IOException, PermissionDeniedException, SshException
add in interface PublicKeyAuthenticationProvideradd in class AbstractPublicKeyAuthenticationProviderjava.io.IOExceptionPermissionDeniedExceptionSshExceptionpublic void remove(SshPublicKey key, SshConnection con) throws java.io.IOException, PermissionDeniedException, SshException
remove in interface PublicKeyAuthenticationProviderremove in class AbstractPublicKeyAuthenticationProviderjava.io.IOExceptionPermissionDeniedExceptionSshExceptionpublic java.util.Iterator<SshPublicKeyFile> getKeys(SshConnection con) throws PermissionDeniedException, java.io.IOException
getKeys in interface PublicKeyAuthenticationProvidergetKeys in class AbstractPublicKeyAuthenticationProviderPermissionDeniedExceptionjava.io.IOExceptionprotected AbstractFile getFile(SshConnection con) throws PermissionDeniedException, java.io.IOException
PermissionDeniedExceptionjava.io.IOExceptionpublic boolean checkKey(SshPublicKey key, SshConnection con) throws java.io.IOException
checkKey in interface PublicKeyAuthenticationProvidercheckKey in class AbstractPublicKeyAuthenticationProviderjava.io.IOExceptionCopyright © 2022. All rights reserved.