1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4 
5 package IceSSL;
6 
7 /**
8  * Interface that allows applications to interact with the IceSSL plug-in.
9  **/
10 public interface Plugin extends Ice.Plugin
11 {
12     /**
13      * Establishes the SSL context. The context must be established before
14      * plug-in is initialized. Therefore, the application must set
15      * the property <code>Ice.InitPlugins</code> to zero, call
16      * <code>setContext</code> to set the context, and finally
17      * invoke PluginManager.initializePlugins().
18      * <p>
19      * If an application supplies its own SSL context, the
20      * plug-in skips its normal property-based configuration.
21      *
22      * @param context The SSL context for the plug-in.
23      **/
setContext(javax.net.ssl.SSLContext context)24     void setContext(javax.net.ssl.SSLContext context);
25 
26     /**
27      * Returns the SSL context. Use caution when modifying the returned
28      * value: changes made to this value do not affect existing connections.
29      *
30      * @return The SSL context for the plug-in.
31      **/
getContext()32     javax.net.ssl.SSLContext getContext();
33 
34     /**
35      * Establishes the certificate verifier. This must be
36      * done before any connections are established.
37      *
38      * @param verifier The certificate verifier.
39      **/
setCertificateVerifier(CertificateVerifier verifier)40     void setCertificateVerifier(CertificateVerifier verifier);
41 
42     /**
43      * Returns the certificate verifier.
44      *
45      * @return The certificate verifier (<code>null</code> if not set).
46      **/
getCertificateVerifier()47     CertificateVerifier getCertificateVerifier();
48 
49     /**
50      * Establishes the password callback. This must be
51      * done before the plug-in is initialized.
52      *
53      * @param callback The password callback.
54      **/
setPasswordCallback(PasswordCallback callback)55     void setPasswordCallback(PasswordCallback callback);
56 
57     /**
58      * Returns the password callback.
59      *
60      * @return The password callback (<code>null</code> if not set).
61      **/
getPasswordCallback()62     PasswordCallback getPasswordCallback();
63 
64     /**
65      * Supplies an input stream for the keystore. Calling this method
66      * causes IceSSL to ignore the <code>IceSSL.Keystore</code> property.
67      *
68      * @param stream The input stream for the keystore.
69      **/
setKeystoreStream(java.io.InputStream stream)70     void setKeystoreStream(java.io.InputStream stream);
71 
72     /**
73      * Supplies an input stream for the truststore. Calling this method
74      * causes IceSSL to ignore the <code>IceSSL.Truststore</code> property. It is
75      * legal to supply the same input stream as the one for {@link #setKeystoreStream},
76      * in which case IceSSL uses the certificates contained in the keystore.
77      *
78      * @param stream The input stream for the truststore.
79      **/
setTruststoreStream(java.io.InputStream stream)80     void setTruststoreStream(java.io.InputStream stream);
81 
82     /**
83      * Adds an input stream for the random number seed. You may call
84      * this method multiple times if necessary.
85      *
86      * @param stream The input stream for the random number seed.
87      **/
addSeedStream(java.io.InputStream stream)88     void addSeedStream(java.io.InputStream stream);
89 }
90