public abstract class AbstractExchange
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static short |
PERFORM_ECDH
The identifier that is used to signal that normal ECDH should be performed.
|
static short |
PERFORM_FAST_ECDH
The identifier that is used to signal that fast ECDH should be performed, this is ignored in the j2se version.
|
static short |
PERFORM_NORMAL_DH
The identifier that is used to signal that normal DH should be performed.
|
Constructor and Description |
---|
AbstractExchange() |
Modifier and Type | Method and Description |
---|---|
static AbstractExchange |
createInstance()
Backup instance creation.
|
static AbstractExchange |
createInstance(short exchangeSemanticType)
Creates a new instance of the DH-Key-Exchange either using the fast ECDH (only with SECP160R1), ECDH or the normal DH.
|
abstract byte[] |
createLocalSecret()
Creates the the BigInteger of this communication end-point.
|
abstract byte[] |
getSharedSecret(byte[] integer)
Creates the shared secret out of the public BigInteger from the communication
partner.
|
static java.lang.Class<? extends AbstractExchange> |
registerInstance(short semantic,
java.lang.Class<? extends AbstractExchange> exchangeClass)
Registers a particular exchange class for handling the exchange of
a certain type.
|
public static final short PERFORM_NORMAL_DH
public static final short PERFORM_ECDH
public static final short PERFORM_FAST_ECDH
public abstract byte[] createLocalSecret() throws java.io.IOException
java.io.IOException
public abstract byte[] getSharedSecret(byte[] integer) throws java.io.IOException
integer
- The BigInteger that was obtained from the communication partner, i.e. the partners public keyjava.io.IOException
public static java.lang.Class<? extends AbstractExchange> registerInstance(short semantic, java.lang.Class<? extends AbstractExchange> exchangeClass)
semantic
- exchangeClass
- public static AbstractExchange createInstance()
DHExchange
object.public static AbstractExchange createInstance(short exchangeSemanticType)
exchangeSemanticType
- A constant that shows which type of DH should be used, e.g. ExchangeSemantic#PERFORM_NORMAL_DH
ExchangeSemantic