KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)SSLContextSpi.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.util.*;
19 import java.security.*;
20
21 /**
22  * This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
23  * for the <code>SSLContext</code> class.
24  *
25  * <p> All the abstract methods in this class must be implemented by each
26  * cryptographic service provider who wishes to supply the implementation
27  * of a particular SSL context.
28  *
29  * @since 1.4
30  * @see SSLContext
31  * @version 1.14
32  */

33 public abstract class SSLContextSpi
34 {
35
36     public SSLContextSpi() { }
37
38     /**
39      * Initializes this context.
40      *
41      * @param km the sources of authentication keys
42      * @param tm the sources of peer authentication trust decisions
43      * @param sr the source of randomness
44      * @throws KeyManagementException if this operation fails
45      * @see SSLContext#init(KeyManager [], TrustManager [], SecureRandom)
46      */

47     protected abstract void engineInit(KeyManager[] km, TrustManager[] tm,
48         SecureRandom sr) throws KeyManagementException;
49
50     /**
51      * Returns a <code>SocketFactory</code> object for this
52      * context.
53      *
54      * @return the <code>SocketFactory</code> object
55      * @see javax.net.ssl.SSLContext#getSocketFactory()
56      */

57     protected abstract SSLSocketFactory engineGetSocketFactory();
58
59     /**
60      * Returns a <code>ServerSocketFactory</code> object for
61      * this context.
62      *
63      * @return the <code>ServerSocketFactory</code> object
64      * @see javax.net.ssl.SSLContext#getServerSocketFactory()
65      */

66     protected abstract SSLServerSocketFactory engineGetServerSocketFactory();
67
68     /**
69      * Creates a new <code>SSLEngine</code> using this context.
70      * <P>
71      * Applications using this factory method are providing no hints
72      * for an internal session reuse strategy. If hints are desired,
73      * {@link #engineCreateSSLEngine(String, int)} should be used
74      * instead.
75      * <P>
76      * Some cipher suites (such as Kerberos) require remote hostname
77      * information, in which case this factory method should not be used.
78      *
79      * @return the <code>SSLEngine</code> Object
80      *
81      * @see SSLContext#createSSLEngine()
82      *
83      * @since 1.5
84      */

85     protected abstract SSLEngine engineCreateSSLEngine();
86
87     /**
88      * Creates a <code>SSLEngine</code> using this context.
89      * <P>
90      * Applications using this factory method are providing hints
91      * for an internal session reuse strategy.
92      * <P>
93      * Some cipher suites (such as Kerberos) require remote hostname
94      * information, in which case peerHost needs to be specified.
95      *
96      * @param host the non-authoritative name of the host
97      * @param port the non-authoritative port
98      * @return the <code>SSLEngine</code> Object
99      *
100      * @see SSLContext#createSSLEngine(String, int)
101      *
102      * @since 1.5
103      */

104     protected abstract SSLEngine engineCreateSSLEngine(String host, int port);
105
106     /**
107      * Returns a server <code>SSLSessionContext</code> object for
108      * this context.
109      *
110      * @return the <code>SSLSessionContext</code> object
111      * @see javax.net.ssl.SSLContext#getServerSessionContext()
112      */

113     protected abstract SSLSessionContext engineGetServerSessionContext();
114
115     /**
116      * Returns a client <code>SSLSessionContext</code> object for
117      * this context.
118      *
119      * @return the <code>SSLSessionContext</code> object
120      * @see javax.net.ssl.SSLContext#getClientSessionContext()
121      */

122     protected abstract SSLSessionContext engineGetClientSessionContext();
123 }
124
Popular Tags