public class DiffieHellmanGroupExchangeSha1JCE extends SshKeyExchangeServer implements AbstractKeyExchange
Modifier and Type | Field and Description |
---|---|
static String |
DIFFIE_HELLMAN_GROUP_EXCHANGE_SHA1
Constant for the algorithm name "diffie-hellman-group1-sha1".
|
clientId, clientKexInit, exchangeHash, firstPacketFollows, hostKey, prvkey, pubkey, secret, serverId, serverKexInit, signature, transport, useFirstPacket
Constructor and Description |
---|
DiffieHellmanGroupExchangeSha1JCE()
Construct an uninitialized instance.
|
DiffieHellmanGroupExchangeSha1JCE(String hashAlgorithm) |
Modifier and Type | Method and Description |
---|---|
protected void |
calculateExchangeHash()
Calculates the exchange hash as an SHA1 hash of the following data.
|
boolean |
exchangeGroup(byte[] msg) |
String |
getAlgorithm()
Get the algorithm name for this key exchange
|
String |
getProvider() |
void |
init(TransportProtocol<SshServerContext> 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
|
getExchangeHash, getHashAlgorithm, getHostKey, getSecret, getSignature, hasReceivedNewKeys, hasSentNewKeys, reset, setReceivedNewKeys, setSentNewKeys, test
public static final String DIFFIE_HELLMAN_GROUP_EXCHANGE_SHA1
public DiffieHellmanGroupExchangeSha1JCE()
public DiffieHellmanGroupExchangeSha1JCE(String hashAlgorithm)
public String getAlgorithm()
getAlgorithm
in interface SshKeyExchange<SshServerContext>
getAlgorithm
in class SshKeyExchangeServer
public void init(TransportProtocol<SshServerContext> transport, String clientIdentification, String serverIdentification, byte[] clientKexInit, byte[] serverKexInit, SshPrivateKey prvkey, SshPublicKey pubkey, boolean firstPacketFollows, boolean useFirstPacket) throws IOException
init
in interface SshKeyExchange<SshServerContext>
IOException
public String getProvider()
getProvider
in interface AbstractKeyExchange
public boolean exchangeGroup(byte[] msg) throws SshException, IOException
SshException
IOException
public boolean processMessage(byte[] msg) throws SshException, IOException
SshKeyExchangeServer
processMessage
in interface SshKeyExchange<SshServerContext>
processMessage
in class SshKeyExchangeServer
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 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
IOException
SshException
Copyright © 2016. All rights reserved.