|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eu.mayrhofer.authentication.AuthenticationEventSender
org.eu.mayrhofer.authentication.relate.DongleProtocolHandler
public class DongleProtocolHandler
This class implements the host part of the authentication protocol between two Relate dongles. It will prepare the data to initialize the dongle authentication mode (i.e. encrypt the shared secret with a block cipher) and check that the nonce received via the ultrasound delays matches (at least as far as the number of bits being used) the received encrypted nonce. Since the authentication protocol will also run as a background thread, this class will emit AuthenticationEvents.
| Field Summary | |
|---|---|
static int |
AuthenticationStages
The number of authentication steps, not including the rounds of the dongles. |
| Fields inherited from class org.eu.mayrhofer.authentication.AuthenticationEventSender |
|---|
eventsHandlers |
| Constructor Summary | |
|---|---|
DongleProtocolHandler(java.lang.String serialPort,
int remoteRelateId,
boolean useJSSE)
Initializes the dongle protocol handler by setting the serialPort and remoteRelateId members. |
|
| Method Summary | |
|---|---|
static boolean |
compareBits(byte[] s,
byte[] t,
int numBits)
Compares a number of bits starting at LSB. |
int |
getDongleInterlockTime()
Returns the time it took to complete the dongle interlock protocol, i.e. |
int |
getRemoteRelateId()
Returns the ID of the remote relate dongle with which this authentication protocol is run. |
int |
getSendCommandTime()
Returns the time that it took to send the start-of-authentication command to the dongle |
static int |
hammingDistance(byte[] s,
byte[] t,
int numBits)
Computes the hamming distance between two bit strings, starting from the LSB. |
void |
startAuthentication(byte[] sharedKey,
int rounds,
int referenceMeasurement)
This method performs a full authentication of the pre-established shared secrets with another Relate dongle.The authentication is started as a background thread. |
| Methods inherited from class org.eu.mayrhofer.authentication.AuthenticationEventSender |
|---|
addAuthenticationProgressHandler, raiseAuthenticationFailureEvent, raiseAuthenticationProgressEvent, raiseAuthenticationSuccessEvent, removeAuthenticationProgressHandler |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int AuthenticationStages
| Constructor Detail |
|---|
public DongleProtocolHandler(java.lang.String serialPort,
int remoteRelateId,
boolean useJSSE)
remoteRelateId - The remote relate id to perform the authentication with.serialPort - The serial port to which the dongle is connected.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.| Method Detail |
|---|
public static boolean compareBits(byte[] s,
byte[] t,
int numBits)
s - The first bit string.t - The second bit string.numBits - The number of bits to compare (starting at LSB).
public static int hammingDistance(byte[] s,
byte[] t,
int numBits)
s - The first bit string.t - The second bit string.numBits - The number of bits to compare (starting at LSB).
public void startAuthentication(byte[] sharedKey,
int rounds,
int referenceMeasurement)
sharedKey - The secret authentication key shared with the remote host.rounds - The number of rounds to use. Due to the protocol and hardware
limitations, the security of this authentication is given by
rounds * EnropyBitsPerRound.referenceMeasurement - The reference measurement to the remote relate
dongle. It is assumed that the real distance between the dongles will not
change during the authentication.public int getSendCommandTime()
public int getDongleInterlockTime()
public int getRemoteRelateId()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||