com.mindbright.ssh2
Class SSH2AuthPublicKey

java.lang.Object
  |
  +--com.mindbright.ssh2.SSH2AuthPublicKey
All Implemented Interfaces:
SSH2AuthModule

public class SSH2AuthPublicKey
extends java.lang.Object
implements SSH2AuthModule

This class implements a module for publickey authentication as defined in the userauth protocol spec. It uses the interface SSH2PKISigner to access an abstract PKI signing mechanism (e.g. implemented with simple file based public/private keys without certificates).

See Also:
SSH2AuthModule, SSH2PKISigner

Field Summary
static java.lang.String STANDARD_NAME
           
 
Constructor Summary
SSH2AuthPublicKey(SSH2PKISigner signer)
           
SSH2AuthPublicKey(SSH2PKISigner signer, boolean test)
           
 
Method Summary
protected  SSH2PKISigner getSigner()
           
 java.lang.String getStandardName()
          Should give the standard name of this module as used in the userauth protocol.
 SSH2TransportPDU processMethodMessage(SSH2UserAuth userAuth, SSH2TransportPDU pdu)
          Processes the given method specific packet and returns a new packet which will be sent to peer to continue the authentication.
 SSH2TransportPDU startAuthentication(SSH2UserAuth userAuth)
          Starts the execution of this module, called from the given SSH2UserAuth.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STANDARD_NAME

public static final java.lang.String STANDARD_NAME
See Also:
Constant Field Values
Constructor Detail

SSH2AuthPublicKey

public SSH2AuthPublicKey(SSH2PKISigner signer)

SSH2AuthPublicKey

public SSH2AuthPublicKey(SSH2PKISigner signer,
                         boolean test)
Method Detail

getSigner

protected SSH2PKISigner getSigner()

getStandardName

public java.lang.String getStandardName()
Description copied from interface: SSH2AuthModule
Should give the standard name of this module as used in the userauth protocol.

Specified by:
getStandardName in interface SSH2AuthModule
Returns:
the standard name of the module

processMethodMessage

public SSH2TransportPDU processMethodMessage(SSH2UserAuth userAuth,
                                             SSH2TransportPDU pdu)
                                      throws SSH2Exception
Description copied from interface: SSH2AuthModule
Processes the given method specific packet and returns a new packet which will be sent to peer to continue the authentication.

Specified by:
processMethodMessage in interface SSH2AuthModule
Parameters:
userAuth - the authentication layer responsible
pdu - the method specific packet
Returns:
the new packet to send to peer, or null if no packet should be sent.
Throws:
SSH2Exception - if an error occurs

startAuthentication

public SSH2TransportPDU startAuthentication(SSH2UserAuth userAuth)
                                     throws SSH2SignatureException
Description copied from interface: SSH2AuthModule
Starts the execution of this module, called from the given SSH2UserAuth.

Specified by:
startAuthentication in interface SSH2AuthModule
Parameters:
userAuth - the authentication layer responsible
Returns:
the packet which starts this authentication method (i.e. when sent to peer)
SSH2SignatureException