Package com.trilead.ssh2.crypto.dh
Class GenericDhExchange
java.lang.Object
com.trilead.ssh2.crypto.dh.GenericDhExchange
- Direct Known Subclasses:
DhExchange
,EcDhExchange
DhExchange.
- Version:
- $Id: DhExchange.java,v 1.2 2008/04/01 12:38:09 cplattne Exp $
- Author:
- Christian Plattner, plattner@trilead.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
calculateH
(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload, byte[] serverKexPayload, byte[] hostKey) abstract byte[]
getE()
abstract String
static GenericDhExchange
getInstance
(String algo) getK()
protected abstract byte[]
abstract void
abstract void
setF
(byte[] f)
-
Constructor Details
-
GenericDhExchange
protected GenericDhExchange()
-
-
Method Details
-
getInstance
-
init
- Throws:
IOException
-
getE
public abstract byte[] getE()- Returns:
- Returns the e (public value)
- Throws:
IllegalStateException
-
getServerE
protected abstract byte[] getServerE()- Returns:
- Returns the server's e (public value)
- Throws:
IllegalStateException
-
getK
- Returns:
- Returns the shared secret k.
- Throws:
IllegalStateException
-
setF
- Parameters:
f
-- Throws:
IOException
-
calculateH
public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload, byte[] serverKexPayload, byte[] hostKey) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
getHashAlgo
-