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
Base class for DHG key exchange algorithms. Implementations will only have to configure the required data on the
DH class in the-
Field Summary
FieldsFields inherited from class net.schmizz.sshj.transport.kex.AbstractDH
dhFields inherited from class net.schmizz.sshj.transport.kex.KeyExchangeBase
digest, H, hostKey, trans -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInitialize the key exchange algorithm.protected abstract voidbooleanProcess the next packetprivate voidverifyCertificate(byte[] K_S) Methods inherited from class net.schmizz.sshj.transport.kex.AbstractDH
getKMethods inherited from class net.schmizz.sshj.transport.kex.KeyExchangeBase
getH, getHash, getHostKey, initializedBuffer
-
Field Details
-
log
private final org.slf4j.Logger log
-
-
Constructor Details
-
AbstractDHG
-
-
Method Details
-
init
public void init(Transport trans, String V_S, String V_C, byte[] I_S, byte[] I_C) throws GeneralSecurityException, TransportException Description copied from interface:KeyExchangeInitialize the key exchange algorithm.- Specified by:
initin interfaceKeyExchange- Overrides:
initin 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:
GeneralSecurityExceptionTransportException- if there is an error sending a packet
-
next
public boolean next(Message msg, SSHPacket packet) throws GeneralSecurityException, TransportException Description copied from interface:KeyExchangeProcess 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:
GeneralSecurityExceptionTransportException- if there is an error sending a packet
-
verifyCertificate
- Throws:
TransportException
-
initDH
- Throws:
GeneralSecurityException
-