public abstract class SshKeyExchangeServer extends Object implements SshKeyExchange
Abstract representation of an SSH key exchange.
| Modifier and Type | Field and Description |
|---|---|
protected 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 SshPrivateKey |
prvkey |
protected SshPublicKey |
pubkey |
protected BigInteger |
secret
The secret value produced during key exchange.
|
protected String |
serverId |
protected byte[] |
serverKexInit |
protected byte[] |
signature
The signature generated over the exchange hash
|
protected AbstractServerTransport |
transport
The transport protocol for sending/receiving messages
|
protected boolean |
useFirstPacket |
| Constructor and Description |
|---|
SshKeyExchangeServer(String hashAlgorithm,
SecurityLevel securityLevel,
int priority)
Contruct an uninitialized key exchange
|
| Modifier and Type | Method and Description |
|---|---|
abstract String |
getAlgorithm()
Get the key exchange algorithm name.
|
byte[] |
getExchangeHash() |
String |
getHashAlgorithm() |
byte[] |
getHostKey() |
int |
getPriority() |
BigInteger |
getSecret() |
SecurityLevel |
getSecurityLevel() |
byte[] |
getSignature() |
boolean |
hasReceivedNewKeys() |
boolean |
hasSentNewKeys() |
abstract void |
init(AbstractServerTransport transport,
String clientId,
String serverId,
byte[] clientKexInit,
byte[] serverKexInit,
SshPrivateKey prvkey,
SshPublicKey pubkey,
boolean firstPacketFollows,
boolean useFirstPacket) |
abstract boolean |
processMessage(byte[] msg)
Process a key exchange message
|
void |
reset()
Reset the key exchange.
|
void |
setReceivedNewKeys(boolean receivedNewKeys) |
void |
setSentNewKeys(boolean sentNewKeys) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetProvider, testprotected BigInteger secret
protected byte[] exchangeHash
protected byte[] hostKey
protected byte[] signature
protected String clientId
protected String serverId
protected byte[] clientKexInit
protected byte[] serverKexInit
protected SshPrivateKey prvkey
protected SshPublicKey pubkey
protected boolean firstPacketFollows
protected boolean useFirstPacket
protected AbstractServerTransport transport
public SshKeyExchangeServer(String hashAlgorithm, SecurityLevel securityLevel, int priority)
public SecurityLevel getSecurityLevel()
getSecurityLevel in interface SecureComponentpublic int getPriority()
getPriority in interface SecureComponentpublic void setReceivedNewKeys(boolean receivedNewKeys)
public void setSentNewKeys(boolean sentNewKeys)
public boolean hasSentNewKeys()
public boolean hasReceivedNewKeys()
public String getHashAlgorithm()
getHashAlgorithm in interface SshKeyExchangepublic abstract String getAlgorithm()
getAlgorithm in interface SshComponentgetAlgorithm in interface SecureComponentpublic byte[] getExchangeHash()
public byte[] getHostKey()
public BigInteger getSecret()
public byte[] getSignature()
public abstract void init(AbstractServerTransport transport, String clientId, String serverId, byte[] clientKexInit, byte[] serverKexInit, SshPrivateKey prvkey, SshPublicKey pubkey, boolean firstPacketFollows, boolean useFirstPacket) throws IOException
IOExceptionpublic abstract boolean processMessage(byte[] msg)
throws SshException,
IOException
msg - IOExceptionSshExceptionpublic void reset()
Copyright © 2025. All rights reserved.