is.logi.crypto.io
Class CipherStreamServer

java.lang.Object
  |
  +--is.logi.crypto.Crypto
        |
        +--is.logi.crypto.io.CipherStream
              |
              +--is.logi.crypto.io.CipherStreamServer

public class CipherStreamServer
extends CipherStream

This class can be used to apply an interactive key exchange protocol to a pair of streams and then encrypt all data going through them with the session key exchanged. This class expects to talk to an equivalent client class.

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

Fields inherited from class is.logi.crypto.Crypto
BIT, cdsPath, keySource, NIBBLE, primeCertainty, random
 
Constructor Summary
CipherStreamServer(java.io.InputStream in, java.io.OutputStream out, InterKeyExServer kex, EncryptMode encrypt, DecryptMode decrypt)
          Create a new CipherStreamServer object and ecxhange keys.
 
Method Summary
 void execute(InterProtocolServer prot)
          Executes an interactive protocol.
 
Methods inherited from class is.logi.crypto.io.CipherStream
getDecryptKey, getEncryptKey, getInputStream, getOutputStream
 
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
 

Constructor Detail

CipherStreamServer

public CipherStreamServer(java.io.InputStream in,
                          java.io.OutputStream out,
                          InterKeyExServer kex,
                          EncryptMode encrypt,
                          DecryptMode decrypt)
                   throws ProtocolException,
                          java.io.IOException
Create a new CipherStreamServer object and ecxhange keys.

Create a new object which uses kex to exchange keys with a remote client and then encrypt to encrypt the data to out and decrypt to decrypt data from in and out.

Throws:
ProtocolException - if there is a problem exchanging keys.
java.io.IOException - if there is a problem with the underlying streams.
Method Detail

execute

public void execute(InterProtocolServer prot)
             throws java.io.IOException,
                    ProtocolException
Executes an interactive protocol.
Throws:
ProtocolException - if there is a problem with the protocol keys.
java.io.IOException - if there is a problem with the underlying streams.


Copyright 1997-1999 Logi Ragnarsson