Package net.schmizz.sshj.transport.kex
Class KeyExchangeBase
- java.lang.Object
-
- net.schmizz.sshj.transport.kex.KeyExchangeBase
-
- All Implemented Interfaces:
KeyExchange
- Direct Known Subclasses:
AbstractDH
public abstract class KeyExchangeBase extends java.lang.Object implements KeyExchange
-
-
Constructor Summary
Constructors Constructor Description KeyExchangeBase(Digest digest)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getH()
Digest
getHash()
The message digest used by this key exchange algorithm.java.security.PublicKey
getHostKey()
void
init(Transport trans, java.lang.String V_S, java.lang.String V_C, byte[] I_S, byte[] I_C)
Initialize the key exchange algorithm.protected Buffer.PlainBuffer
initializedBuffer()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.schmizz.sshj.transport.kex.KeyExchange
getK, next
-
-
-
-
Constructor Detail
-
KeyExchangeBase
public KeyExchangeBase(Digest digest)
-
-
Method Detail
-
init
public void init(Transport trans, java.lang.String V_S, java.lang.String V_C, byte[] I_S, byte[] I_C) throws java.security.GeneralSecurityException, TransportException
Description copied from interface:KeyExchange
Initialize the key exchange algorithm.- Specified by:
init
in interfaceKeyExchange
- Parameters:
trans
- the transportV_S
- the server identification stringV_C
- the client identification stringI_S
- the server key init packetI_C
- the client key init packet- Throws:
java.security.GeneralSecurityException
TransportException
- if there is an error sending a packet
-
initializedBuffer
protected Buffer.PlainBuffer initializedBuffer()
-
getH
public byte[] getH()
- Specified by:
getH
in interfaceKeyExchange
- Returns:
- the computed H parameter
-
getHash
public Digest getHash()
Description copied from interface:KeyExchange
The message digest used by this key exchange algorithm.- Specified by:
getHash
in interfaceKeyExchange
- Returns:
- the message digest
-
getHostKey
public java.security.PublicKey getHostKey()
- Specified by:
getHostKey
in interfaceKeyExchange
- Returns:
- the host key determined from server's response packets
-
-