All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class is.logi.crypto.protocols.DHKeyExServer

java.lang.Object
   |
   +----is.logi.crypto.Crypto
           |
           +----is.logi.crypto.protocols.DHKeyEx
                   |
                   +----is.logi.crypto.protocols.DHKeyExServer

public class DHKeyExServer
extends DHKeyEx
implements InterKeyExServer
Diffie-Hellman key exchange server. It expects to talk to a DHKeyExClient object.

Author:
Logi Ragnarsson (logir@hi.is)
See Also:
DHKeyExClient

Constructor Index

 o DHKeyExServer(DHKey, String)
Create a new DHKeyExServer object.
 o DHKeyExServer(int, String)
Create a new DHKeyExClient object.

Method Index

 o message(byte[])
Get the next message in the protocol.

Constructors

 o DHKeyExServer
 public DHKeyExServer(DHKey pri,
                      String keyType) throws KeyException
Create a new DHKeyExServer object. It uses the private DH key from pri.

Throws: KeyException
if the key is not private.
 o DHKeyExServer
 public DHKeyExServer(int n,
                      String keyType)
Create a new DHKeyExClient object. It uses an n bit modulus and the named key type.

There are pre-computed public modulus and gnerator pairs for these values of n: 256, 512, 1024, 2048. Using one of these values saves you from a rather long wait.

Methods

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

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

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

Throws: ProtocolException
if a problem arises with the protocol.

All Packages  Class Hierarchy  This Package  Previous  Next  Index