public class DiffieHellmanGroup1Sha1JCE extends SshKeyExchangeClient
Modifier and Type | Field and Description |
---|---|
static String |
DIFFIE_HELLMAN_GROUP1_SHA1
Constant for the algorithm name "diffie-hellman-group1-sha1".
|
clientId, clientKexInit, exchangeHash, firstPacketFollows, hostKey, key, secret, serverId, serverKexInit, signature, transport, useFirstPacket
Constructor and Description |
---|
DiffieHellmanGroup1Sha1JCE()
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 |
getHashAlgorithm() |
String |
getProvider() |
void |
init(TransportProtocol<SshClientContext> transport,
String clientId,
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, getHostKey, getSecret, getSignature, hasReceivedNewKeys, hasSentNewKeys, isComplete, reset, setReceivedNewKeys, setSentNewKeys
public static final String DIFFIE_HELLMAN_GROUP1_SHA1
public DiffieHellmanGroup1Sha1JCE()
public String getAlgorithm()
public void init(TransportProtocol<SshClientContext> transport, String clientId, String serverId, byte[] clientKexInit, byte[] serverKexInit, SshPrivateKey prvkey, SshPublicKey pubkey, boolean firstPacketFollows, boolean useFirstPacket) throws IOException, SshException
IOException
SshException
public String getProvider()
public boolean processMessage(byte[] m) throws SshException, IOException
SshKeyExchangeClient
processMessage
in interface SshKeyExchange<SshClientContext>
processMessage
in class SshKeyExchangeClient
SshException
IOException
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
public boolean isKeyExchangeMessage(int messageid)
public String getHashAlgorithm()
public void test() throws IOException, SshException
IOException
SshException
Copyright © 2016. All rights reserved.