KickJava   Java API By Example, From Geeks To Geeks.

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


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.net.InetAddress JavaDoc;
11 import java.net.ServerSocket JavaDoc;
12 import java.net.Socket JavaDoc;
13 import javax.crypto.SecretKey;
14
15 /**
16  *
17  * @author Scott.Stark@jboss.org
18  */

19 public class CipherServerSocket extends ServerSocket JavaDoc
20 {
21    String JavaDoc algorithm;
22    SecretKey key;
23
24    /** Creates a new instance of CipherServerSocket */
25    public CipherServerSocket(int port, int backlog,
26       InetAddress JavaDoc bindAddr, String JavaDoc algorithm, SecretKey key) throws IOException JavaDoc
27    {
28       super(port, backlog, bindAddr);
29       this.algorithm = algorithm;
30       this.key = key;
31    }
32
33    public Socket JavaDoc accept() throws IOException JavaDoc
34    {
35       Socket JavaDoc s = super.accept();
36       return new CipherSocket(s, algorithm, key);
37    }
38 }
39
Popular Tags