public abstract class

AbstractDHG

extends Object
implements KeyExchange
java.lang.Object
   ↳ net.schmizz.sshj.transport.kex.AbstractDHG
Known Direct Subclasses

Class Overview

Base class for DHG key exchange algorithms. Implementations will only have to configure the required data on the DH class in the

Summary

Fields
private byte[] H
private byte[] I_C
private byte[] I_S
private String V_C
private String V_S
private final DH dh
private PublicKey hostKey
private final Logger log
private final Digest sha1
private Transport trans
Public Constructors
AbstractDHG()
Public Methods
byte[] getH()
Digest getHash()
The message digest used by this key exchange algorithm.
PublicKey getHostKey()
BigInteger getK()
void init(Transport trans, String V_S, String V_C, byte[] I_S, byte[] I_C)
Initialize the key exchange algorithm.
boolean next(Message msg, SSHPacket packet)
Process the next packet
Protected Methods
abstract void initDH(DH dh)
[Expand]
Inherited Methods
From class java.lang.Object
From interface net.schmizz.sshj.transport.kex.KeyExchange

Fields

private byte[] H

private byte[] I_C

private byte[] I_S

private String V_C

private String V_S

private final DH dh

private PublicKey hostKey

private final Logger log

private final Digest sha1

private Transport trans

Public Constructors

public AbstractDHG ()

Public Methods

public byte[] getH ()

public Digest getHash ()

The message digest used by this key exchange algorithm.

Returns
  • the message digest

public PublicKey getHostKey ()

public BigInteger getK ()

public void init (Transport trans, String V_S, String V_C, byte[] I_S, byte[] I_C)

Initialize the key exchange algorithm.

Parameters
trans The transport
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
GeneralSecurityException
TransportException

public boolean next (Message msg, SSHPacket packet)

Process the next packet

Parameters
msg Message identifier
packet The packet
Returns
  • a boolean indicating if the processing is complete or if more packets are to be received
Throws
GeneralSecurityException
TransportException

Protected Methods

protected abstract void initDH (DH dh)

Parameters
dh
Throws
GeneralSecurityException