org.logi.crypto.protocols
Class QRAuthServer

java.lang.Object
  |
  +--org.logi.crypto.Crypto
        |
        +--org.logi.crypto.protocols.QRAuth
              |
              +--org.logi.crypto.protocols.QRAuthServer
All Implemented Interfaces:
InterAuthServer, InterProtocolServer

public class QRAuthServer
extends org.logi.crypto.protocols.QRAuth
implements InterAuthServer

Query-response authenticaton server. It expects to talk to a QRAuthClient object.

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

Author:
Logi Ragnarsson (logir@logi.org)
See Also:
QRAuthServer

Fields inherited from class org.logi.crypto.Crypto
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO
 
Constructor Summary
QRAuthServer(CipherKey key)
          Creates a new QRAuthServer object with the specified secret key.
 
Method Summary
 boolean completed()
          Returns true iff this end of the protocol is completed.
 int maxMessageSize()
          Returns the maximum expected size of a message for this protocol.
 byte[] message(byte[] received)
          Get the next message in the protocol.
 
Methods inherited from class org.logi.crypto.Crypto
binString, binString, ensureArrayLength, ensureArrayLength, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, prettyPrint, prettyPrint, readBlock, readInt, trimArrayLength, trimArrayLength, trimLeadingZeroes, writeBytes, writeBytes, writeInt
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.logi.crypto.protocols.InterProtocolServer
completed, maxMessageSize
 

Constructor Detail

QRAuthServer

public QRAuthServer(CipherKey key)
Creates a new QRAuthServer 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 InterProtocolServer
Throws:
CryptoProtocolException - if a problem arises with the protocol.

completed

public boolean completed()
Returns true iff this end of the protocol is completed.

maxMessageSize

public int maxMessageSize()
Returns the maximum expected size of a message for this protocol.


Copyright (c) 1997-2001 Logi Ragnarsson - Distributed under the GPL