public abstract class SshKeyExchangeServer extends Object implements SshKeyExchange<SshServerContext>
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 TransportProtocol<SshServerContext> |
transport
The transport protocol for sending/receiving messages
|
protected boolean |
useFirstPacket |
Constructor and Description |
---|
SshKeyExchangeServer(String hashAlgorithm)
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() |
BigInteger |
getSecret() |
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) |
void |
test() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init
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 TransportProtocol<SshServerContext> transport
public SshKeyExchangeServer(String hashAlgorithm)
public void setReceivedNewKeys(boolean receivedNewKeys)
setReceivedNewKeys
in interface SshKeyExchange<SshServerContext>
public void setSentNewKeys(boolean sentNewKeys)
setSentNewKeys
in interface SshKeyExchange<SshServerContext>
public boolean hasSentNewKeys()
hasSentNewKeys
in interface SshKeyExchange<SshServerContext>
public boolean hasReceivedNewKeys()
hasReceivedNewKeys
in interface SshKeyExchange<SshServerContext>
public String getHashAlgorithm()
getHashAlgorithm
in interface SshKeyExchange<SshServerContext>
public abstract String getAlgorithm()
getAlgorithm
in interface SshKeyExchange<SshServerContext>
public byte[] getExchangeHash()
getExchangeHash
in interface SshKeyExchange<SshServerContext>
public byte[] getHostKey()
public BigInteger getSecret()
getSecret
in interface SshKeyExchange<SshServerContext>
public byte[] getSignature()
public abstract boolean processMessage(byte[] msg) throws SshException, IOException
processMessage
in interface SshKeyExchange<SshServerContext>
msg
- IOException
SshException
public void reset()
public void test() throws IOException
test
in interface SshKeyExchange<SshServerContext>
IOException
Copyright © 2016. All rights reserved.