Package com.sshtools.client.components
Class Rsa1024Sha1
java.lang.Object
com.sshtools.client.SshKeyExchangeClient
com.sshtools.client.components.Rsa1024Sha1
- All Implemented Interfaces:
Component,SshComponent,SecureComponent,AbstractKeyExchange,SshKeyExchange<SshClientContext>
Implementation of RFC 4432 https://tools.ietf.org/html/rfc4432
- Author:
- Lee David Painter
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant for the algorithm name "rsa1024-sha1".Fields inherited from class com.sshtools.client.SshKeyExchangeClient
e, exchangeHash, f, firstPacketFollows, hostKey, key, secret, signature, transport, useFirstPacket -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalculates the exchange hash as an SHA1 hash of the following data.Get the algorithm name for this key exchangevoidinit(SshTransport<SshClientContext> transport, String clientId, String serverId, byte[] clientKexInit, byte[] serverKexInit, SshPrivateKey prvkey, SshPublicKey pubkey, boolean firstPacketFollows, boolean useFirstPacket) booleanisKeyExchangeMessage(int messageid) booleanprocessMessage(byte[] tmp) 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, setSentNewKeys
-
Field Details
-
RSA_1024_SHA1
Constant for the algorithm name "rsa1024-sha1".- See Also:
-
-
Constructor Details
-
Rsa1024Sha1
public Rsa1024Sha1()Construct an uninitialized instance.
-
-
Method Details
-
getAlgorithm
Get the algorithm name for this key exchange- Specified by:
getAlgorithmin interfaceSecureComponent- Specified by:
getAlgorithmin interfaceSshComponent- Specified by:
getAlgorithmin interfaceSshKeyExchange<SshClientContext>- Returns:
- "diffie-hellman-group1-sha1"
-
getProvider
- Specified by:
getProviderin interfaceAbstractKeyExchange- Specified by:
getProviderin interfaceSshKeyExchange<SshClientContext>
-
test
public void test()- Specified by:
testin interfaceSshKeyExchange<SshClientContext>
-
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
-
calculateExchangeHash
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
- Overrides:
calculateExchangeHashin classSshKeyExchangeClient- Throws:
IOExceptionSshException
-
isKeyExchangeMessage
public boolean isKeyExchangeMessage(int messageid)
-