public class DiffieHellmanGroupExchangeSha1JCE extends SshKeyExchangeServer implements com.sshtools.synergy.ssh.components.jce.AbstractKeyExchange
Modifier and Type | Field and Description |
---|---|
static java.lang.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(java.lang.String hashAlgorithm,
com.sshtools.common.ssh.SecurityLevel securityLevel,
int priority) |
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) |
java.lang.String |
getAlgorithm()
Get the algorithm name for this key exchange
|
java.lang.String |
getProvider() |
void |
init(com.sshtools.synergy.ssh.SshTransport<SshServerContext> transport,
java.lang.String clientIdentification,
java.lang.String serverIdentification,
byte[] clientKexInit,
byte[] serverKexInit,
com.sshtools.common.ssh.components.SshPrivateKey prvkey,
com.sshtools.common.ssh.components.SshPublicKey pubkey,
boolean firstPacketFollows,
boolean useFirstPacket) |
void |
prepareGroup() |
boolean |
processMessage(byte[] msg)
Process a key exchange message
|
void |
test() |
getExchangeHash, getHashAlgorithm, getHostKey, getPriority, getSecret, getSecurityLevel, getSignature, hasReceivedNewKeys, hasSentNewKeys, reset, setReceivedNewKeys, setSentNewKeys
public static final java.lang.String DIFFIE_HELLMAN_GROUP_EXCHANGE_SHA1
public DiffieHellmanGroupExchangeSha1JCE()
public DiffieHellmanGroupExchangeSha1JCE(java.lang.String hashAlgorithm, com.sshtools.common.ssh.SecurityLevel securityLevel, int priority)
public java.lang.String getAlgorithm()
getAlgorithm
in interface com.sshtools.common.ssh.components.SshComponent
getAlgorithm
in interface com.sshtools.common.ssh.SecureComponent
getAlgorithm
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
getAlgorithm
in class SshKeyExchangeServer
public void init(com.sshtools.synergy.ssh.SshTransport<SshServerContext> transport, java.lang.String clientIdentification, java.lang.String serverIdentification, byte[] clientKexInit, byte[] serverKexInit, com.sshtools.common.ssh.components.SshPrivateKey prvkey, com.sshtools.common.ssh.components.SshPublicKey pubkey, boolean firstPacketFollows, boolean useFirstPacket) throws java.io.IOException
init
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
java.io.IOException
public java.lang.String getProvider()
getProvider
in interface com.sshtools.synergy.ssh.components.jce.AbstractKeyExchange
getProvider
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
public boolean exchangeGroup(byte[] msg) throws com.sshtools.common.ssh.SshException, java.io.IOException
com.sshtools.common.ssh.SshException
java.io.IOException
public void prepareGroup()
public boolean processMessage(byte[] msg) throws com.sshtools.common.ssh.SshException, java.io.IOException
SshKeyExchangeServer
processMessage
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
processMessage
in class SshKeyExchangeServer
com.sshtools.common.ssh.SshException
java.io.IOException
protected void calculateExchangeHash() throws com.sshtools.common.ssh.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
java.io.IOException
com.sshtools.common.ssh.SshException
public void test()
test
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
Copyright © 2022. All rights reserved.