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, wait
getProvider, test
protected 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 SecureComponent
public int getPriority()
getPriority
in interface SecureComponent
public void setReceivedNewKeys(boolean receivedNewKeys)
public void setSentNewKeys(boolean sentNewKeys)
public boolean hasSentNewKeys()
public boolean hasReceivedNewKeys()
public String getHashAlgorithm()
getHashAlgorithm
in interface SshKeyExchange
public abstract String getAlgorithm()
getAlgorithm
in interface SshComponent
getAlgorithm
in interface SecureComponent
public 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
IOException
public abstract boolean processMessage(byte[] msg) throws SshException, IOException
msg
- IOException
SshException
public void reset()
Copyright © 2024. All rights reserved.