src/share/classes/javax/net/ssl/SSLContext.java

Print this page




 143         GetInstance.Instance instance = GetInstance.getInstance
 144                 ("SSLContext", SSLContextSpi.class, protocol);
 145         return new SSLContext((SSLContextSpi)instance.impl, instance.provider,
 146                 protocol);
 147     }
 148 
 149     /**
 150      * Returns a <code>SSLContext</code> object that implements the
 151      * specified secure socket protocol.
 152      *
 153      * <p> A new SSLContext object encapsulating the
 154      * SSLContextSpi implementation from the specified provider
 155      * is returned.  The specified provider must be registered
 156      * in the security provider list.
 157      *
 158      * <p> Note that the list of registered providers may be retrieved via
 159      * the {@link Security#getProviders() Security.getProviders()} method.
 160      *
 161      * @param protocol the standard name of the requested protocol.
 162      *          See Appendix A in the <a href=
 163      *  "{@docRoot}/../technotes/guides//security/jsse/JSSERefGuide.html#AppA">
 164      *          Java Secure Socket Extension Reference Guide </a>
 165      *          for information about standard protocol names.
 166      *
 167      * @param provider the name of the provider.
 168      *
 169      * @return the new <code>SSLContext</code> object.
 170      *
 171      * @throws NoSuchAlgorithmException if a SSLContextSpi
 172      *          implementation for the specified protocol is not
 173      *          available from the specified provider.
 174      *
 175      * @throws NoSuchProviderException if the specified provider is not
 176      *          registered in the security provider list.
 177      *
 178      * @throws IllegalArgumentException if the provider name is null or empty.
 179      * @throws NullPointerException if protocol is null.
 180      *
 181      * @see java.security.Provider
 182      */
 183     public static SSLContext getInstance(String protocol, String provider)




 143         GetInstance.Instance instance = GetInstance.getInstance
 144                 ("SSLContext", SSLContextSpi.class, protocol);
 145         return new SSLContext((SSLContextSpi)instance.impl, instance.provider,
 146                 protocol);
 147     }
 148 
 149     /**
 150      * Returns a <code>SSLContext</code> object that implements the
 151      * specified secure socket protocol.
 152      *
 153      * <p> A new SSLContext object encapsulating the
 154      * SSLContextSpi implementation from the specified provider
 155      * is returned.  The specified provider must be registered
 156      * in the security provider list.
 157      *
 158      * <p> Note that the list of registered providers may be retrieved via
 159      * the {@link Security#getProviders() Security.getProviders()} method.
 160      *
 161      * @param protocol the standard name of the requested protocol.
 162      *          See Appendix A in the <a href=
 163      *  "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html#AppA">
 164      *          Java Secure Socket Extension Reference Guide </a>
 165      *          for information about standard protocol names.
 166      *
 167      * @param provider the name of the provider.
 168      *
 169      * @return the new <code>SSLContext</code> object.
 170      *
 171      * @throws NoSuchAlgorithmException if a SSLContextSpi
 172      *          implementation for the specified protocol is not
 173      *          available from the specified provider.
 174      *
 175      * @throws NoSuchProviderException if the specified provider is not
 176      *          registered in the security provider list.
 177      *
 178      * @throws IllegalArgumentException if the provider name is null or empty.
 179      * @throws NullPointerException if protocol is null.
 180      *
 181      * @see java.security.Provider
 182      */
 183     public static SSLContext getInstance(String protocol, String provider)