Package com.sshtools.j2ssh.agent
Class AgentAuthenticationClient
- java.lang.Object
-
- com.sshtools.j2ssh.authentication.SshAuthenticationClient
-
- com.sshtools.j2ssh.agent.AgentAuthenticationClient
-
public class AgentAuthenticationClient extends SshAuthenticationClient
Provides an application with an authentication mechanism that links to the sshtools agent; the agent stores private keys and can hash and sign data for the public key authentication request.
- Version:
- $Revision: 1.19 $
- Author:
- Lee David Painter
-
-
Field Summary
Fields Modifier and Type Field Description protected SshAgentClient
agent
-
Constructor Summary
Constructors Constructor Description AgentAuthenticationClient()
Creates a new AgentAuthenticationClient object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptsKey(AuthenticationProtocolClient authentication, java.lang.String username, java.lang.String serviceToStart, SshPublicKey key)
void
authenticate(AuthenticationProtocolClient authentication, java.lang.String serviceToStart)
boolean
canAuthenticate()
java.lang.String
getMethodName()
java.util.Properties
getPersistableProperties()
boolean
hasAcceptableKey(SshClient ssh)
void
reset()
void
setAgent(SshAgentClient agent)
void
setPersistableProperties(java.util.Properties properties)
boolean
showAuthenticationDialog(java.awt.Component parent)
-
Methods inherited from class com.sshtools.j2ssh.authentication.SshAuthenticationClient
canPrompt, getAuthenticationPrompt, getUsername, setAuthenticationPrompt, setUsername
-
-
-
-
Field Detail
-
agent
protected SshAgentClient agent
-
-
Method Detail
-
setAgent
public void setAgent(SshAgentClient agent)
-
reset
public void reset()
- Specified by:
reset
in classSshAuthenticationClient
-
getMethodName
public java.lang.String getMethodName()
- Specified by:
getMethodName
in classSshAuthenticationClient
- Returns:
-
acceptsKey
public boolean acceptsKey(AuthenticationProtocolClient authentication, java.lang.String username, java.lang.String serviceToStart, SshPublicKey key) throws java.io.IOException
- Parameters:
authentication
-username
-serviceToStart
-key
-- Returns:
- Throws:
java.io.IOException
-
authenticate
public void authenticate(AuthenticationProtocolClient authentication, java.lang.String serviceToStart) throws java.io.IOException, TerminatedStateException
- Specified by:
authenticate
in classSshAuthenticationClient
- Parameters:
authentication
-serviceToStart
-- Throws:
java.io.IOException
TerminatedStateException
AuthenticationProtocolException
-
showAuthenticationDialog
public boolean showAuthenticationDialog(java.awt.Component parent)
- Parameters:
parent
-- Returns:
-
getPersistableProperties
public java.util.Properties getPersistableProperties()
- Specified by:
getPersistableProperties
in classSshAuthenticationClient
- Returns:
-
setPersistableProperties
public void setPersistableProperties(java.util.Properties properties)
- Specified by:
setPersistableProperties
in classSshAuthenticationClient
- Parameters:
properties
-
-
canAuthenticate
public boolean canAuthenticate()
- Specified by:
canAuthenticate
in classSshAuthenticationClient
- Returns:
-
hasAcceptableKey
public boolean hasAcceptableKey(SshClient ssh)
- Parameters:
ssh
-- Returns:
-
-