Class PublicKeyAuthenticationClient
- java.lang.Object
-
- com.sshtools.j2ssh.authentication.SshAuthenticationClient
-
- com.sshtools.j2ssh.authentication.PublicKeyAuthenticationClient
-
public class PublicKeyAuthenticationClient extends SshAuthenticationClient
- Version:
- $Revision: 1.21 $
- Author:
- $author$
-
-
Field Summary
Fields Modifier and Type Field Description protected SshPrivateKey
key
-
Constructor Summary
Constructors Constructor Description PublicKeyAuthenticationClient()
Creates a new PublicKeyAuthenticationClient 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
getKeyfile()
java.lang.String
getMethodName()
java.util.Properties
getPersistableProperties()
void
reset()
void
setKey(SshPrivateKey key)
void
setKeyfile(java.lang.String privateKeyFile)
void
setPersistableProperties(java.util.Properties properties)
-
Methods inherited from class com.sshtools.j2ssh.authentication.SshAuthenticationClient
canPrompt, getAuthenticationPrompt, getUsername, setAuthenticationPrompt, setUsername
-
-
-
-
Field Detail
-
key
protected SshPrivateKey key
-
-
Method Detail
-
setKey
public void setKey(SshPrivateKey key)
- Parameters:
key
-
-
setKeyfile
public void setKeyfile(java.lang.String privateKeyFile)
-
getKeyfile
public java.lang.String getKeyfile()
-
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
-
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:
-
-