com.maverick.sshd.auth
Class AuthorizedKeysPublicKeyAuthenticationProvider

java.lang.Object
  extended by com.maverick.sshd.PublicKeyAuthenticationProvider
      extended by com.maverick.sshd.auth.AuthorizedKeysPublicKeyAuthenticationProvider
All Implemented Interfaces:
AuthenticationProvider

public class AuthorizedKeysPublicKeyAuthenticationProvider
extends PublicKeyAuthenticationProvider

This class implements the OpenSSH style authorized_keys public key store.

Author:
Lee David Painter

Field Summary
protected  String authorizedKeysFile
          The path relative to the users home directory from which to load authorized keys
 
Constructor Summary
AuthorizedKeysPublicKeyAuthenticationProvider()
          Create a default authorized_keys store that reads keys from .ssh/authorized_keys.
AuthorizedKeysPublicKeyAuthenticationProvider(String authorizedKeysFile)
          Create an authorized keys stores that reads keys from a custom location.
 
Method Summary
 boolean isAuthorizedKey(com.maverick.ssh.components.SshPublicKey key, Connection con)
          Checks the given public key by comparing it against the public keys stored in the users authorized_keys file.
 
Methods inherited from class com.maverick.sshd.PublicKeyAuthenticationProvider
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

authorizedKeysFile

protected String authorizedKeysFile
The path relative to the users home directory from which to load authorized keys

Constructor Detail

AuthorizedKeysPublicKeyAuthenticationProvider

public AuthorizedKeysPublicKeyAuthenticationProvider()
Create a default authorized_keys store that reads keys from .ssh/authorized_keys.


AuthorizedKeysPublicKeyAuthenticationProvider

public AuthorizedKeysPublicKeyAuthenticationProvider(String authorizedKeysFile)
Create an authorized keys stores that reads keys from a custom location.

Parameters:
authorizedKeysFile - String
Method Detail

isAuthorizedKey

public boolean isAuthorizedKey(com.maverick.ssh.components.SshPublicKey key,
                               Connection con)
Checks the given public key by comparing it against the public keys stored in the users authorized_keys file.

Specified by:
isAuthorizedKey in class PublicKeyAuthenticationProvider
Parameters:
key - SshPublicKey
sessionid - byte[]
authenticationProvider - AuthenticationProvider
Returns:
boolean


Copyright © 2012. All Rights Reserved.