public class DiffieHellmanGroup extends SshKeyExchangeServer implements AbstractKeyExchange
Implementation of the required SSH Transport Protocol key exchange method "diffie-hellman-group1-sha1".
clientId, clientKexInit, exchangeHash, firstPacketFollows, hostKey, prvkey, pubkey, secret, serverId, serverKexInit, signature, transport, useFirstPacket
Modifier | Constructor and Description |
---|---|
protected |
DiffieHellmanGroup(String algorithmName,
String hashAlgorithm,
BigInteger group,
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.
|
String |
getAlgorithm()
Get the algorithm name for this key exchange
|
String |
getProvider() |
void |
init(AbstractServerTransport transport,
String clientIdentification,
String serverIdentification,
byte[] clientKexInit,
byte[] serverKexInit,
SshPrivateKey prvkey,
SshPublicKey pubkey,
boolean firstPacketFollows,
boolean useFirstPacket) |
boolean |
processMessage(byte[] msg)
Process a key exchange message
|
void |
test() |
getExchangeHash, getHashAlgorithm, getHostKey, getPriority, getSecret, getSecurityLevel, getSignature, hasReceivedNewKeys, hasSentNewKeys, reset, setReceivedNewKeys, setSentNewKeys
protected DiffieHellmanGroup(String algorithmName, String hashAlgorithm, BigInteger group, SecurityLevel securityLevel, int priority)
public String getAlgorithm()
getAlgorithm
in interface SshComponent
getAlgorithm
in interface SecureComponent
getAlgorithm
in class SshKeyExchangeServer
public void test()
test
in interface SshKeyExchange
public void init(AbstractServerTransport transport, String clientIdentification, String serverIdentification, byte[] clientKexInit, byte[] serverKexInit, SshPrivateKey prvkey, SshPublicKey pubkey, boolean firstPacketFollows, boolean useFirstPacket) throws IOException
init
in class SshKeyExchangeServer
IOException
public String getProvider()
getProvider
in interface AbstractKeyExchange
getProvider
in interface SshKeyExchange
public boolean processMessage(byte[] msg) throws SshException, IOException
SshKeyExchangeServer
processMessage
in class SshKeyExchangeServer
IOException
SshException
protected 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 BigInteger e, exchange value sent by the client BigInteger f, exchange value sent by the server BigInteger K, the shared secret
IOException
SshException
Copyright © 2024. All rights reserved.