public class DiffieHellmanGroupExchange extends SshKeyExchangeClient implements AbstractKeyExchange
clientId, clientKexInit, exchangeHash, firstPacketFollows, hostKey, key, secret, serverId, serverKexInit, signature, transport, useFirstPacket| Constructor and Description |
|---|
DiffieHellmanGroupExchange(java.lang.String kexAlgorithm,
java.lang.String hashAlgorithm,
SecurityLevel securityLevel,
int priority)
Construct an uninitialized instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateExchangeHash()
Calculates the exchange hash as an SHA1 hash of the following data.
|
boolean |
exchangeGroup(com.sshtools.common.util.ByteArrayReader msg) |
java.lang.String |
getAlgorithm()
Get the algorithm name for this key exchange
|
java.lang.String |
getProvider() |
void |
init(SshTransport<SshClientContext> transport,
java.lang.String clientIdentification,
java.lang.String serverIdentification,
byte[] clientKexInit,
byte[] serverKexInit,
boolean firstPacketFollows,
boolean useFirstPacket) |
void |
init(SshTransport<SshClientContext> transport,
java.lang.String clientId,
java.lang.String serverId,
byte[] clientKexInit,
byte[] serverKexInit,
SshPrivateKey prvkey,
SshPublicKey pubkey,
boolean firstPacketFollows,
boolean useFirstPacket) |
boolean |
isKeyExchangeMessage(int messageid) |
boolean |
processMessage(byte[] m)
Process a key exchange message
|
void |
test() |
getExchangeHash, getHashAlgorithm, getHostKey, getPriority, getSecret, getSecurityLevel, getSignature, hasReceivedNewKeys, hasSentNewKeys, isComplete, reset, setReceivedNewKeys, setSentNewKeyspublic DiffieHellmanGroupExchange(java.lang.String kexAlgorithm,
java.lang.String hashAlgorithm,
SecurityLevel securityLevel,
int priority)
public java.lang.String getAlgorithm()
getAlgorithm in interface SshComponentgetAlgorithm in interface SecureComponentgetAlgorithm in interface SshKeyExchange<SshClientContext>public void init(SshTransport<SshClientContext> transport, java.lang.String clientIdentification, java.lang.String serverIdentification, byte[] clientKexInit, byte[] serverKexInit, boolean firstPacketFollows, boolean useFirstPacket) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getProvider()
getProvider in interface AbstractKeyExchangegetProvider in interface SshKeyExchange<SshClientContext>public boolean exchangeGroup(com.sshtools.common.util.ByteArrayReader msg)
throws SshException,
java.io.IOException
SshExceptionjava.io.IOExceptionpublic boolean processMessage(byte[] m)
throws SshException,
java.io.IOException
SshKeyExchangeClientprocessMessage in interface SshKeyExchange<SshClientContext>processMessage in class SshKeyExchangeClientSshExceptionjava.io.IOExceptionprotected void calculateExchangeHash()
throws SshException
Calculates the exchange hash as an SHA1 hash of the following data.
String the client's version string (CR and NL excluded) String the server's version string (CR and NL excluded) String the payload of the client's SSH_MSG_KEXINIT String the payload of the server's SSH_MSG_KEXINIT String the host key UnsignedInteger32 min UnsignedInteger32 n UnsignedInteger32 max BigInteger p BigInteger g BigInteger e, exchange value sent by the client BigInteger f, exchange value sent by the server BigInteger K, the shared secret
calculateExchangeHash in class SshKeyExchangeClientjava.io.IOExceptionSshExceptionpublic boolean isKeyExchangeMessage(int messageid)
public void init(SshTransport<SshClientContext> transport, java.lang.String clientId, java.lang.String serverId, byte[] clientKexInit, byte[] serverKexInit, SshPrivateKey prvkey, SshPublicKey pubkey, boolean firstPacketFollows, boolean useFirstPacket) throws java.io.IOException, SshException
init in interface SshKeyExchange<SshClientContext>java.io.IOExceptionSshExceptionpublic void test()
throws java.io.IOException,
SshException
test in interface SshKeyExchange<SshClientContext>java.io.IOExceptionSshExceptionCopyright © 2022. All rights reserved.