Package net.schmizz.sshj.transport.kex
Class AbstractDHG
- java.lang.Object
-
- net.schmizz.sshj.transport.kex.KeyExchangeBase
-
- net.schmizz.sshj.transport.kex.AbstractDH
-
- net.schmizz.sshj.transport.kex.AbstractDHG
-
- All Implemented Interfaces:
KeyExchange
- Direct Known Subclasses:
Curve25519SHA256
,DHG
,DHG1
,DHG14
,ECDHNistP
public abstract class AbstractDHG extends AbstractDH
Base class for DHG key exchange algorithms. Implementations will only have to configure the required data on theDH
class in the
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.Logger
log
-
Fields inherited from class net.schmizz.sshj.transport.kex.AbstractDH
dh
-
Fields inherited from class net.schmizz.sshj.transport.kex.KeyExchangeBase
digest, H, hostKey, trans
-
-
Constructor Summary
Constructors Constructor Description AbstractDHG(DHBase dhBase, Digest digest)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
init(Transport trans, java.lang.String V_S, java.lang.String V_C, byte[] I_S, byte[] I_C)
Initialize the key exchange algorithm.protected abstract void
initDH(DHBase dh)
boolean
next(Message msg, SSHPacket packet)
Process the next packetprivate void
verifyCertificate(byte[] K_S)
-
Methods inherited from class net.schmizz.sshj.transport.kex.AbstractDH
getK
-
Methods inherited from class net.schmizz.sshj.transport.kex.KeyExchangeBase
getH, getHash, getHostKey, initializedBuffer
-
-
-
-
Method Detail
-
init
public void init(Transport trans, java.lang.String V_S, java.lang.String V_C, byte[] I_S, byte[] I_C) throws java.security.GeneralSecurityException, TransportException
Description copied from interface:KeyExchange
Initialize the key exchange algorithm.- Specified by:
init
in interfaceKeyExchange
- Overrides:
init
in classKeyExchangeBase
- Parameters:
trans
- the transportV_S
- the server identification stringV_C
- the client identification stringI_S
- the server key init packetI_C
- the client key init packet- Throws:
java.security.GeneralSecurityException
TransportException
- if there is an error sending a packet
-
next
public boolean next(Message msg, SSHPacket packet) throws java.security.GeneralSecurityException, TransportException
Description copied from interface:KeyExchange
Process the next packet- Parameters:
msg
- message identifierpacket
- the packet- Returns:
- a boolean indicating if the processing is complete or if more packets are to be received
- Throws:
java.security.GeneralSecurityException
TransportException
- if there is an error sending a packet
-
verifyCertificate
private void verifyCertificate(byte[] K_S) throws TransportException
- Throws:
TransportException
-
initDH
protected abstract void initDH(DHBase dh) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
-