org.logi.crypto.protocols
Class QRAuthClient

java.lang.Object
  extended byorg.logi.crypto.Crypto
      extended byorg.logi.crypto.protocols.QRAuth
          extended byorg.logi.crypto.protocols.QRAuthClient
All Implemented Interfaces:
InterAuthClient, InterProtocolClient

public class QRAuthClient
extends QRAuth
implements InterAuthClient

Query-response authenticaton client. It expects to talk to a QRAuthServer object.

If the protocol is completed, the client is certain that the server also knows the secret key passed to the constructor.

See Also:
QRAuthServer

Field Summary
 
Fields inherited from class org.logi.crypto.protocols.QRAuth
completed, key, r
 
Fields inherited from class org.logi.crypto.Crypto
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO
 
Constructor Summary
QRAuthClient(CipherKey key)
          Creates a new QRAuthClient object with the specified secret key.
 
Method Summary
 byte[] message(byte[] received)
          Get the next message in the protocol.
 
Methods inherited from class org.logi.crypto.protocols.QRAuth
addOne, completed, maxMessageSize
 
Methods inherited from class org.logi.crypto.Crypto
binString, binString, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, readBlock, readInt, writeBytes, writeBytes, writeInt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.logi.crypto.protocols.InterProtocolClient
completed, maxMessageSize
 

Constructor Detail

QRAuthClient

public QRAuthClient(CipherKey key)
Creates a new QRAuthClient object with the specified secret key.

Method Detail

message

public byte[] message(byte[] received)
               throws CryptoProtocolException
Get the next message in the protocol.

received is the last message received form the server and has not yet been sent to the client.

The returned value is the next message to send to the server or null if no more messages need to be sent and the protocol is terminated.

Specified by:
message in interface InterProtocolClient
Throws:
CryptoProtocolException - if a problem arises with the protocol.