Package com.sshtools.client.components
Class Rsa2048Sha256
java.lang.Object
com.sshtools.client.SshKeyExchangeClient
com.sshtools.client.components.Rsa2048Sha256
- 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 "rsa2048-sha256".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) 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_2048_SHA256
Constant for the algorithm name "rsa2048-sha256".- See Also:
-
-
Constructor Details
-
Rsa2048Sha256
public Rsa2048Sha256()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
-