Package com.sshtools.client.components
Class DiffieHellmanEcdh
java.lang.Object
com.sshtools.client.SshKeyExchangeClient
com.sshtools.client.components.DiffieHellmanEcdh
- All Implemented Interfaces:
Component,SshComponent,SecureComponent,SshKeyExchange<SshClientContext>
- Direct Known Subclasses:
DiffieHellmanEcdhNistp256,DiffieHellmanEcdhNistp384,DiffieHellmanEcdhNistp521
public abstract class DiffieHellmanEcdh
extends SshKeyExchangeClient
implements SshKeyExchange<SshClientContext>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intFields inherited from class com.sshtools.client.SshKeyExchangeClient
e, exchangeHash, f, firstPacketFollows, hostKey, key, secret, signature, transport, useFirstPacket -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDiffieHellmanEcdh(String name, String curve, String hashAlgorithm, SecurityLevel securityLevel, int priority) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalculates the exchange hash as an SHA1 hash of the following data.voidinit(SshTransport<SshClientContext> transport, String clientId, String serverId, byte[] clientKexInit, byte[] serverKexInit, SshPrivateKey prvkey, SshPublicKey pubkey, boolean firstPacketFollows, boolean useFirstPacket) booleanprocessMessage(byte[] msg) Process a key exchange messagevoidtest()Methods inherited from class com.sshtools.client.SshKeyExchangeClient
getExchangeHash, getHashAlgorithm, getHostKey, getPriority, getSecret, getSecurityLevel, getSignature, hasReceivedNewKeys, hasSentNewKeys, isComplete, reset, setReceivedNewKeys, setSentNewKeysMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sshtools.common.ssh.SecureComponent
getPriority, getSecurityLevelMethods inherited from interface com.sshtools.synergy.ssh.components.SshKeyExchange
getExchangeHash, getHashAlgorithm, getHostKey, getSecret, getSignature, hasReceivedNewKeys, hasSentNewKeys, setReceivedNewKeys, setSentNewKeys
-
Field Details
-
SSH_MSG_KEX_ECDH_INIT
public static final int SSH_MSG_KEX_ECDH_INIT- See Also:
-
SSH_MSG_KEX_ECDH_REPLY
public static final int SSH_MSG_KEX_ECDH_REPLY- See Also:
-
-
Constructor Details
-
DiffieHellmanEcdh
protected DiffieHellmanEcdh(String name, String curve, String hashAlgorithm, SecurityLevel securityLevel, int priority)
-
-
Method Details
-
getAlgorithm
- Specified by:
getAlgorithmin interfaceSecureComponent- Specified by:
getAlgorithmin interfaceSshComponent- Specified by:
getAlgorithmin interfaceSshKeyExchange<SshClientContext>
-
calculateExchangeHash
Description copied from class:SshKeyExchangeClientCalculates 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
- Overrides:
calculateExchangeHashin classSshKeyExchangeClient- Throws:
SshException
-
init
public void init(SshTransport<SshClientContext> transport, String clientId, String serverId, byte[] clientKexInit, byte[] serverKexInit, SshPrivateKey prvkey, SshPublicKey pubkey, boolean firstPacketFollows, boolean useFirstPacket) throws IOException, SshException - Specified by:
initin interfaceSshKeyExchange<SshClientContext>- Throws:
IOExceptionSshException
-
processMessage
Description copied from class:SshKeyExchangeClientProcess a key exchange message- Specified by:
processMessagein interfaceSshKeyExchange<SshClientContext>- Specified by:
processMessagein classSshKeyExchangeClient- Returns:
- boolean, indicating whether it has processed the message or not
- Throws:
SshExceptionIOException
-
getProvider
- Specified by:
getProviderin interfaceSshKeyExchange<SshClientContext>
-
test
- Specified by:
testin interfaceSshKeyExchange<SshClientContext>- Throws:
IOExceptionSshException
-