KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > crypto > CipherClientSocketFactory


1 /*
2  * JBoss, the OpenSource J2EE WebOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.crypto;
8
9 import java.io.IOException JavaDoc;
10 import java.io.Serializable JavaDoc;
11 import java.net.Socket JavaDoc;
12 import java.rmi.server.RMIClientSocketFactory JavaDoc;
13
14 import org.jboss.logging.Logger;
15
16 /** An implementation of RMIClientSocketFactory that uses the JCE Cipher
17  with an SRP session key to create an encrypted stream.
18
19 @author Scott.Stark@jboss.org
20 @version $Revision: 1.3 $
21 */

22 public class CipherClientSocketFactory implements RMIClientSocketFactory JavaDoc, Serializable JavaDoc
23 {
24    private static final long serialVersionUID = -6412485012870705607L;
25
26    /** Creates new CipherClientSocketFactory */
27    public CipherClientSocketFactory()
28    {
29    }
30
31    /** Create a client socket connected to the specified host and port.
32    * @param host - the host name
33    * @param port - the port number
34    * @return a socket connected to the specified host and port.
35    * @exception IOException if an I/O error occurs during socket creation.
36    */

37    public Socket JavaDoc createSocket(String JavaDoc host, int port)
38       throws IOException JavaDoc
39    {
40       CipherSocket socket = null;
41       return socket;
42    }
43
44    public boolean equals(Object JavaDoc obj)
45    {
46       return obj instanceof CipherClientSocketFactory;
47    }
48    public int hashCode()
49    {
50       return getClass().getName().hashCode();
51    }
52
53 }
54
Popular Tags