public abstract class SshKeyExchangeServer extends java.lang.Object implements com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
Abstract representation of an SSH key exchange.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
clientId |
protected byte[] |
clientKexInit |
protected byte[] |
exchangeHash
The exchange hash produced during key exchange.
|
protected boolean |
firstPacketFollows |
protected byte[] |
hostKey
The server's host key.
|
protected com.sshtools.common.ssh.components.SshPrivateKey |
prvkey |
protected com.sshtools.common.ssh.components.SshPublicKey |
pubkey |
protected java.math.BigInteger |
secret
The secret value produced during key exchange.
|
protected java.lang.String |
serverId |
protected byte[] |
serverKexInit |
protected byte[] |
signature
The signature generated over the exchange hash
|
protected com.sshtools.synergy.ssh.SshTransport<SshServerContext> |
transport
The transport protocol for sending/receiving messages
|
protected boolean |
useFirstPacket |
Constructor and Description |
---|
SshKeyExchangeServer(java.lang.String hashAlgorithm,
com.sshtools.common.ssh.SecurityLevel securityLevel,
int priority)
Contruct an uninitialized key exchange
|
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
getAlgorithm()
Get the key exchange algorithm name.
|
byte[] |
getExchangeHash() |
java.lang.String |
getHashAlgorithm() |
byte[] |
getHostKey() |
int |
getPriority() |
java.math.BigInteger |
getSecret() |
com.sshtools.common.ssh.SecurityLevel |
getSecurityLevel() |
byte[] |
getSignature() |
boolean |
hasReceivedNewKeys() |
boolean |
hasSentNewKeys() |
abstract boolean |
processMessage(byte[] msg)
Process a key exchange message
|
void |
reset()
Reset the key exchange.
|
void |
setReceivedNewKeys(boolean receivedNewKeys) |
void |
setSentNewKeys(boolean sentNewKeys) |
protected java.math.BigInteger secret
protected byte[] exchangeHash
protected byte[] hostKey
protected byte[] signature
protected java.lang.String clientId
protected java.lang.String serverId
protected byte[] clientKexInit
protected byte[] serverKexInit
protected com.sshtools.common.ssh.components.SshPrivateKey prvkey
protected com.sshtools.common.ssh.components.SshPublicKey pubkey
protected boolean firstPacketFollows
protected boolean useFirstPacket
protected com.sshtools.synergy.ssh.SshTransport<SshServerContext> transport
public SshKeyExchangeServer(java.lang.String hashAlgorithm, com.sshtools.common.ssh.SecurityLevel securityLevel, int priority)
public com.sshtools.common.ssh.SecurityLevel getSecurityLevel()
getSecurityLevel
in interface com.sshtools.common.ssh.SecureComponent
public int getPriority()
getPriority
in interface com.sshtools.common.ssh.SecureComponent
public void setReceivedNewKeys(boolean receivedNewKeys)
setReceivedNewKeys
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
public void setSentNewKeys(boolean sentNewKeys)
setSentNewKeys
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
public boolean hasSentNewKeys()
hasSentNewKeys
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
public boolean hasReceivedNewKeys()
hasReceivedNewKeys
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
public java.lang.String getHashAlgorithm()
getHashAlgorithm
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
public abstract 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>
public byte[] getExchangeHash()
getExchangeHash
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
public byte[] getHostKey()
getHostKey
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
public java.math.BigInteger getSecret()
getSecret
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
public byte[] getSignature()
getSignature
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
public abstract boolean processMessage(byte[] msg) throws com.sshtools.common.ssh.SshException, java.io.IOException
processMessage
in interface com.sshtools.synergy.ssh.components.SshKeyExchange<SshServerContext>
msg
- java.io.IOException
com.sshtools.common.ssh.SshException
public void reset()
Copyright © 2023. All rights reserved.