KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > net > ssl > SSLSocketFactory


1 /*
2  * @(#)SSLSocketFactory.java 1.11 04/02/16
3  *
4  * Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7   
8 /*
9  * NOTE:
10  * Because of various external restrictions (i.e. US export
11  * regulations, etc.), the actual source code can not be provided
12  * at this time. This file represents the skeleton of the source
13  * file, so that javadocs of the API can be created.
14  */

15
16 package javax.net.ssl;
17
18 import java.net.*;
19 import java.security.*;
20
21 import javax.net.SocketFactory;
22 import java.io.IOException;
23 import com.sun.net.ssl.internal.ssl.Debug;
24 import com.sun.net.ssl.internal.ssl.ExportControl;
25
26 /**
27  * <code>SSLSocketFactory</code>s create <code>SSLSocket</code>s.
28  *
29  * @since 1.4
30  * @see SSLSocket
31  * @version 1.20
32  * @author David Brownell
33  */

34 public abstract class SSLSocketFactory extends SocketFactory
35 {
36
37     /**
38      * Constructor is used only by subclasses.
39      */

40     public SSLSocketFactory() { }
41
42     /**
43      * Returns the default SSL socket factory.
44      * The default implementation can be changed by setting the value of the
45      * "ssl.SocketFactory.provider" security property (in the Java
46      * security properties file) to the desired class.
47      *
48      * <p>If SSL has not been
49      * configured properly for this virtual machine, the factory will be
50      * inoperative (reporting instantiation exceptions).
51      *
52      * @return the default <code>SocketFactory</code>
53      */

54     public static synchronized SocketFactory getDefault() {
55         return null;
56     }
57
58     /**
59      * Returns the list of cipher suites which are enabled by default.
60      * Unless a different list is enabled, handshaking on an SSL connection
61      * will use one of these cipher suites. The minimum quality of service
62      * for these defaults requires confidentiality protection and server
63      * authentication (that is, no anonymous cipher suites).
64      *
65      * @see #getSupportedCipherSuites()
66      * @return array of the cipher suites enabled by default
67      */

68     public abstract String[] getDefaultCipherSuites();
69
70     /**
71      * Returns the names of the cipher suites which could be enabled for use
72      * on an SSL connection. Normally, only a subset of these will actually
73      * be enabled by default, since this list may include cipher suites which
74      * do not meet quality of service requirements for those defaults. Such
75      * cipher suites are useful in specialized applications.
76      *
77      * @see #getDefaultCipherSuites()
78      * @return an array of cipher suite names
79      */

80     public abstract String[] getSupportedCipherSuites();
81
82     /**
83      * Returns a socket layered over an existing socket connected to the named
84      * host, at the given port. This constructor can be used when tunneling SSL
85      * through a proxy or when negotiating the use of SSL over an existing
86      * socket. The host and port refer to the logical peer destination.
87      * This socket is configured using the socket options established for
88      * this factory.
89      *
90      * @param s the existing socket
91      * @param host the server host
92      * @param port the server port
93      * @param autoClose close the underlying socket when this socket is closed
94      * @return a socket connected to the specified host and port
95      * @throws IOException if an I/O error occurs when creating the socket
96      * @throws UnknownHostException if the host is not known
97      */

98     public abstract Socket createSocket(Socket s, String host, int port, boolean
99         autoClose) throws IOException;
100 }
101
Popular Tags