org.logi.crypto.protocols
Class DHKeyExNoninter

java.lang.Object
  |
  +--org.logi.crypto.Crypto
        |
        +--org.logi.crypto.protocols.DHKeyEx
              |
              +--org.logi.crypto.protocols.DHKeyExNoninter
All Implemented Interfaces:
InterKeyExClient, InterKeyExServer, InterProtocolClient, InterProtocolServer, NoninterKeyExClient, NoninterKeyExServer, NoninterProtocolClient, NoninterProtocolServer

public class DHKeyExNoninter
extends DHKeyEx
implements NoninterKeyExClient, NoninterKeyExServer

Diffie-Hellman key exchange without exchanging keys. Both parties need to know the other party's public DHKey. No messages are sent in either direction, but a unique session key is created for each pair of Diffie-Hellman keys used.

This class is both the client and server for the protocol.

Author:
Logi Ragnarsson (logir@logi.org)
See Also:
DHKeyExServer, DHKeyExClient, DHKey

Fields inherited from class org.logi.crypto.Crypto
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO
 
Constructor Summary
DHKeyExNoninter(DHKey pri, DHKey pub, java.lang.String keyType)
          Create a new DHKeyExClient object which uses the private DH key from pri and the public DH key from pri to generate a session key.
 
Method Summary
 byte[] message(byte[] received)
          Expects and sends null, since no messages are needed for this protocol.
 
Methods inherited from class org.logi.crypto.protocols.DHKeyEx
completed, maxMessageSize, sessionKey
 
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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.logi.crypto.protocols.InterProtocolClient
completed, maxMessageSize
 
Methods inherited from interface org.logi.crypto.protocols.InterKeyExClient
sessionKey
 
Methods inherited from interface org.logi.crypto.protocols.InterProtocolServer
completed, maxMessageSize
 
Methods inherited from interface org.logi.crypto.protocols.InterKeyExServer
sessionKey
 

Constructor Detail

DHKeyExNoninter

public DHKeyExNoninter(DHKey pri,
                       DHKey pub,
                       java.lang.String keyType)
                throws KeyException,
                       InvalidCDSException
Create a new DHKeyExClient object which uses the private DH key from pri and the public DH key from pri to generate a session key.
Throws:
KeyException - if the public/private flag of either key is wrong.
InvalidCDSException - if the session key object can not be created.
Method Detail

message

public byte[] message(byte[] received)
               throws CryptoProtocolException
Expects and sends null, since no messages are needed for this protocol.
Specified by:
message in interface InterProtocolClient
Throws:
CryptoProtocolException - if called with a parameter other than null.


Copyright 1997-2000 Logi Ragnarsson