is.logi.crypto.protocols
Class DHKeyExClient
java.lang.Object
|
+--is.logi.crypto.Crypto
|
+--is.logi.crypto.protocols.DHKeyEx
|
+--is.logi.crypto.protocols.DHKeyExClient
- public class DHKeyExClient
- extends DHKeyEx
- implements InterKeyExClient
Diffie-Hellman key exchange client. It expects to talk to a
DHKeyExServer object.
- Author:
- Logi Ragnarsson
(logir@hi.is)
- See Also:
DHKeyExServer
Constructor Summary |
DHKeyExClient(DHKey pri,
java.lang.String keyType)
Create a new DHKeyExClient object. |
DHKeyExClient(int n,
java.lang.String keyType)
Create a new DHKeyExClient object. |
Method Summary |
byte[] |
message(byte[] received)
Get the next message in the protocol.
|
Methods inherited from class is.logi.crypto.Crypto |
binString,
binString,
equal,
equalRelaxed,
equalSub,
fromHexNibble,
fromHexString,
fromString,
fromString,
hexString,
hexString,
hexString,
hexString,
makeClass,
makeInt,
makeLong,
makeSessionKey,
pastSpace,
pickBits,
pickBits,
readInt,
writeBytes,
writeBytes,
writeInt |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DHKeyExClient
public DHKeyExClient(DHKey pri,
java.lang.String keyType)
throws KeyException
- Create a new DHKeyExClient object. It uses
the private DH key from
pri
.
- Throws:
- KeyException - if the key is not private.
DHKeyExClient
public DHKeyExClient(int n,
java.lang.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.
message
public byte[] message(byte[] received)
throws ProtocolException
- 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.
- Throws:
- ProtocolException - if a problem arises with the protocol.
Copyright 1997-1999 Logi Ragnarsson