org.apache.sshd.client.kex
Class AbstractDHGClient

java.lang.Object
  extended by org.apache.sshd.client.kex.AbstractDHGClient
All Implemented Interfaces:
KeyExchange
Direct Known Subclasses:
DHG1, DHG14

public abstract class AbstractDHGClient
extends Object
implements KeyExchange

Base class for DHG key exchange algorithms. Implementations will only have to configure the required data on the DH class in the initDH(org.apache.sshd.common.kex.DH) method.

Author:
Apache MINA SSHD Project

Constructor Summary
AbstractDHGClient()
           
 
Method Summary
 byte[] getH()
          Retrieves the computed H parameter
 Digest getHash()
          The message digest used by this key exchange algorithm.
 byte[] getK()
          Retrieves the computed K parameter
 PublicKey getServerKey()
          Retrieves the server's key
 void init(AbstractSession s, byte[] V_S, byte[] V_C, byte[] I_S, byte[] I_C)
          Initialize the key exchange algorithm.
protected abstract  void initDH(DH dh)
           
 boolean next(Buffer buffer)
          Process the next packet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDHGClient

public AbstractDHGClient()
Method Detail

init

public void init(AbstractSession s,
                 byte[] V_S,
                 byte[] V_C,
                 byte[] I_S,
                 byte[] I_C)
          throws Exception
Description copied from interface: KeyExchange
Initialize the key exchange algorithm.

Specified by:
init in interface KeyExchange
Parameters:
s - the session using this algorithm
V_S - the server identification string
V_C - the client identification string
I_S - the server key init packet
I_C - the client key init packet
Throws:
Exception - if an error occurs

initDH

protected abstract void initDH(DH dh)

next

public boolean next(Buffer buffer)
             throws Exception
Description copied from interface: KeyExchange
Process the next packet

Specified by:
next in interface KeyExchange
Parameters:
buffer - the packet
Returns:
a boolean indicating if the processing is complete or if more packets are to be received
Throws:
Exception - if an error occurs

getHash

public Digest getHash()
Description copied from interface: KeyExchange
The message digest used by this key exchange algorithm.

Specified by:
getHash in interface KeyExchange
Returns:
the message digest

getH

public byte[] getH()
Description copied from interface: KeyExchange
Retrieves the computed H parameter

Specified by:
getH in interface KeyExchange
Returns:

getK

public byte[] getK()
Description copied from interface: KeyExchange
Retrieves the computed K parameter

Specified by:
getK in interface KeyExchange
Returns:

getServerKey

public PublicKey getServerKey()
Description copied from interface: KeyExchange
Retrieves the server's key

Specified by:
getServerKey in interface KeyExchange


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.