Class IDatagramSocket

java.lang.Object
  extended by IDatagramSocket

public final class IDatagramSocket
extends java.lang.Object

This class utilizes the power of object oriented programming to create a simpler, safer type. It eliminates a lot of the functionality of DatagramSocket to only what feralcore needs. So, when you see this type passed around within feralcore, it is immediately clear how methods that take it as input can (and cannot) manipulate the state of the underlying DatagramSocket object. For some DatagramSocket methods this holds without even looking at the code that uses the IDatagramSocket object.


Constructor Summary
IDatagramSocket()
           
IDatagramSocket(int port)
           
 
Method Summary
 void close()
           
 Sendtofcres sendToFeralcoreNode(Fc3tuple tuple, ByteArray plaintext, java.math.BigInteger parta, java.math.BigInteger partb, YYrandom yyrandomobj)
          This function is the same as the other sendToFeralcoreNode() call except that it takes (parta,partb) as input, part of an ElGamal encryption computation.
 Sendtofcres sendToFeralcoreNodeNoPrecomputation(Fc3tuple tuple, ByteArray plaintext, YYrandom yyrandomobj)
          This function is used to send fcsend objects to a remote feralcore node.
 boolean yypacketreceive(int timeout, java.net.DatagramPacket recvpacket)
           
 void yypacketsend(java.net.DatagramPacket dpacket)
           
 void yypacketsendsi(Serverinfo si, ByteArray msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDatagramSocket

public IDatagramSocket()
                throws FeralcoreException,
                       java.net.SocketException
Throws:
FeralcoreException
java.net.SocketException

IDatagramSocket

public IDatagramSocket(int port)
                throws java.net.SocketException
Throws:
java.net.SocketException
Method Detail

yypacketsend

public void yypacketsend(java.net.DatagramPacket dpacket)
                  throws java.io.IOException
Throws:
java.io.IOException

yypacketsendsi

public void yypacketsendsi(Serverinfo si,
                           ByteArray msg)
                    throws FeralcoreException,
                           java.net.UnknownHostException,
                           java.io.IOException
Throws:
FeralcoreException
java.net.UnknownHostException
java.io.IOException

yypacketreceive

public boolean yypacketreceive(int timeout,
                               java.net.DatagramPacket recvpacket)
                        throws java.io.IOException
Throws:
java.io.IOException

close

public void close()

sendToFeralcoreNodeNoPrecomputation

public Sendtofcres sendToFeralcoreNodeNoPrecomputation(Fc3tuple tuple,
                                                       ByteArray plaintext,
                                                       YYrandom yyrandomobj)
                                                throws FeralcoreException,
                                                       java.security.NoSuchAlgorithmException,
                                                       javax.crypto.NoSuchPaddingException,
                                                       java.security.InvalidKeyException,
                                                       javax.crypto.IllegalBlockSizeException,
                                                       javax.crypto.BadPaddingException,
                                                       java.io.FileNotFoundException,
                                                       java.io.IOException,
                                                       java.lang.InterruptedException,
                                                       java.lang.CloneNotSupportedException
This function is used to send fcsend objects to a remote feralcore node. This includes programs being sent as well as ping messages. It takes as input a plaintext message, encrypts it, and sends it out. This call is public since an APICall in Process.java calls it.

Parameters:
yyrandomobj - An instance of YYrandom used in the hybrid cryptosystem.
Throws:
FeralcoreException
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
java.security.InvalidKeyException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
java.io.FileNotFoundException
java.io.IOException
java.lang.InterruptedException
java.lang.CloneNotSupportedException

sendToFeralcoreNode

public Sendtofcres sendToFeralcoreNode(Fc3tuple tuple,
                                       ByteArray plaintext,
                                       java.math.BigInteger parta,
                                       java.math.BigInteger partb,
                                       YYrandom yyrandomobj)
                                throws FeralcoreException,
                                       java.security.NoSuchAlgorithmException,
                                       javax.crypto.NoSuchPaddingException,
                                       java.security.InvalidKeyException,
                                       javax.crypto.IllegalBlockSizeException,
                                       javax.crypto.BadPaddingException,
                                       java.io.FileNotFoundException,
                                       java.io.IOException,
                                       java.lang.InterruptedException,
                                       java.lang.CloneNotSupportedException
This function is the same as the other sendToFeralcoreNode() call except that it takes (parta,partb) as input, part of an ElGamal encryption computation. Here (parta,partb) = (g^k,y^k) for random exponent k.

Throws:
FeralcoreException
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
java.security.InvalidKeyException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
java.io.FileNotFoundException
java.io.IOException
java.lang.InterruptedException
java.lang.CloneNotSupportedException