|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openuat.authentication.SimpleKeyAgreement
public class SimpleKeyAgreement
This class implements a simple key agreement protocol. Simple refers to the interface of this class, not its security. For a complete key agreement, the caller is expected to initialize the object, transmit the public key to the remote host, receive the remote public key and add it to this agreements and then get the shared authentication and session keys. Each caller is expected to handle the transmitted public keys and especially the private keys with care and not leak it to an outside class. The steps must be done in exactly this order or a KeyAgreementProtocolException will be thrown.
| Field Summary | |
|---|---|
static java.math.BigInteger |
skip1024Base
The base used with the SKIP 1024 bit modulus |
static java.math.BigInteger |
skip1024Modulus
The SKIP 1024 bit modulus. |
| Constructor Summary | |
|---|---|
SimpleKeyAgreement(boolean useJSSE)
Initialized a fresh key agreement, simply by calling init(). |
|
SimpleKeyAgreement(boolean useJSSE,
boolean permanentLocalKeyPair)
Initialized a fresh key agreement, simply by calling init(). |
|
SimpleKeyAgreement(byte[] localKeyPair)
|
|
| Method Summary | |
|---|---|
void |
addRemotePublicKey(byte[] key)
Add the remote public key. |
byte[] |
getAuthenticationKey()
This method can only be called in state completed. |
byte[] |
getPublicKey()
Get the public key for the key agreement protocol. |
byte[] |
getSessionKey()
This method can only be called in state completed. |
void |
init(boolean useJSSE)
Initializes the random nonce of this side for generating the shared session key. |
void |
resetRemotePart()
This resets the remote parts (if they have already been added) so that another round can be started with the same local key pair. |
byte[] |
storeLocalKeyPair()
|
void |
wipe()
This method performs a secure wipe of the cryptographic key material held by this class by overwriting the memory regions with zero before freeing them (i.e. handing them over to the garbage collector, which might free them at an unpredictable time later, marking them for overwrite at an even later time). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.math.BigInteger skip1024Modulus
public static final java.math.BigInteger skip1024Base
| Constructor Detail |
|---|
public SimpleKeyAgreement(boolean useJSSE,
boolean permanentLocalKeyPair)
throws InternalApplicationException
useJSSE - If set to true, the JSSE API with the default JCE
provider of the JVM will be used for cryptographic
operations. If set to false, an internal copy of the
Bouncycastle Lightweight API classes will be used.permanentLocalKeyPair - Is set to true, then a few checks are
relaxed and the same key agreement instance may be
used for multiple Diffie-Hellman rounds with different
remote public keys. Before a second key agreement round
can be started, resetRemotePart() must be called.
This option should be used only in special circumstances
when ephemeral keys can not be supported!
InternalApplicationExceptioninit(boolean)
public SimpleKeyAgreement(boolean useJSSE)
throws InternalApplicationException
useJSSE - If set to true, the JSSE API with the default JCE
provider of the JVM will be used for cryptographic
operations. If set to false, an internal copy of the
Bouncycastle Lightweight API classes will be used.
InternalApplicationExceptioninit(boolean)public SimpleKeyAgreement(byte[] localKeyPair)
| Method Detail |
|---|
public byte[] storeLocalKeyPair()
public void init(boolean useJSSE)
throws InternalApplicationException
useJSSE - If set to true, the JSSE API with the default JCE
provider of the JVM will be used for cryptographic
operations. If set to false, an internal copy of the
Bouncycastle Lightweight API classes will be used.
InternalApplicationExceptionwipe()public void wipe()
sharedKey,
myKeypair,
dh
public void resetRemotePart()
throws KeyAgreementProtocolException,
InternalApplicationException
KeyAgreementProtocolException
InternalApplicationException
public byte[] getPublicKey()
throws KeyAgreementProtocolException
KeyAgreementProtocolException
public void addRemotePublicKey(byte[] key)
throws KeyAgreementProtocolException,
InternalApplicationException
KeyAgreementProtocolException
InternalApplicationException
public byte[] getSessionKey()
throws KeyAgreementProtocolException,
InternalApplicationException
KeyAgreementProtocolException
InternalApplicationException
public byte[] getAuthenticationKey()
throws KeyAgreementProtocolException,
InternalApplicationException
KeyAgreementProtocolException
InternalApplicationException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||