public class OpenSshCACertificateStoreImpl extends Object implements PublicKeyAuthenticationProvider
Constructor and Description |
---|
OpenSshCACertificateStoreImpl(Collection<SshPublicKey> caPublicKeys) |
OpenSshCACertificateStoreImpl(SshPublicKey caPublicKey) |
Modifier and Type | Method and Description |
---|---|
void |
add(SshPublicKey key,
String comment,
Connection<SshServerContext> con) |
void |
addCAKey(SshPublicKey caKey) |
Iterator<SshPublicKeyFile> |
getKeys(Connection<SshServerContext> con) |
boolean |
isAuthorizedKey(SshPublicKey key,
Connection<SshServerContext> con)
Check the supplied public key against the users authorized keys.
|
void |
remove(SshPublicKey key,
Connection<SshServerContext> con) |
void |
removeKey(SshPublicKey caKey) |
public OpenSshCACertificateStoreImpl(SshPublicKey caPublicKey)
public OpenSshCACertificateStoreImpl(Collection<SshPublicKey> caPublicKeys)
public void addCAKey(SshPublicKey caKey) throws SshException
SshException
public void removeKey(SshPublicKey caKey)
public boolean isAuthorizedKey(SshPublicKey key, Connection<SshServerContext> con)
PublicKeyAuthenticationProvider
Check the supplied public key against the users authorized keys. The
actual verification of the key is performed by the server, you only need
to return a value to indicate whether the key is authorized or not. You
can obtain the username, home directory, group or remote socket address
from the PasswordAuthenticationProvider
instance.
If your authorized key database is kept on the native file system you can
obtain and initialize an instance as follows:
Don't forget to close any file handles and the file system once you've done accessing files.NativeFileSystemProvider nfs = (NativeFileSystemProvider) authenticationProvider .getContext().getFileSystemProvider().newInstance(); nfs.init(sessionid, null, authenticationProvider.getContext());
isAuthorizedKey
in interface PublicKeyAuthenticationProvider
key
- SshPublicKeycon
- connectionpublic Iterator<SshPublicKeyFile> getKeys(Connection<SshServerContext> con) throws PermissionDeniedException, IOException
getKeys
in interface PublicKeyAuthenticationProvider
PermissionDeniedException
IOException
public void remove(SshPublicKey key, Connection<SshServerContext> con) throws IOException, PermissionDeniedException, SshException
remove
in interface PublicKeyAuthenticationProvider
IOException
PermissionDeniedException
SshException
public void add(SshPublicKey key, String comment, Connection<SshServerContext> con) throws IOException, PermissionDeniedException, SshException
add
in interface PublicKeyAuthenticationProvider
IOException
PermissionDeniedException
SshException
Copyright © 2016. All rights reserved.