IT. Expert System.

Android Reference

SSLContext


javax.net.ssl

Class SSLContext



  • public class SSLContext
    extends Object
    The public API for secure socket protocol implementations. It acts as factory for SSLSocketFactory's and SSLEngines.
    • Constructor Detail

      • SSLContext

        protected SSLContext(SSLContextSpi contextSpi,
                  Provider provider,
                  String protocol)
        Creates a new SSLContext.
        Parameters:
        contextSpi - the implementation delegate.
        provider - the provider.
        protocol - the protocol name.
    • Method Detail

      • setDefault

        public static void setDefault(SSLContext sslContext)
        Sets the default SSLContext instance as returned by getDefault() to a non-null initialized value.
        Throws:
        NullPointerException - on a null argument
        Since:
        1.6
      • getInstance

        public static SSLContext getInstance(String protocol)
                                      throws NoSuchAlgorithmException
        Creates a new SSLContext instance for the specified protocol.
        Parameters:
        protocol - the requested protocol to create a context for.
        Returns:
        the created SSLContext instance.
        Throws:
        NoSuchAlgorithmException - if no installed provider can provide the requested protocol
        NullPointerException - if protocol is null (instead of NoSuchAlgorithmException as in 1.4 release)
      • getInstance

        public static SSLContext getInstance(String protocol,
                             String provider)
                                      throws NoSuchAlgorithmException,
                                             NoSuchProviderException
        Creates a new SSLContext instance for the specified protocol from the specified provider.
        Parameters:
        protocol - the requested protocol to create a context for.
        provider - the name of the provider that provides the requested protocol.
        Returns:
        an SSLContext for the requested protocol.
        Throws:
        NoSuchAlgorithmException - if the specified provider cannot provider the requested protocol.
        NoSuchProviderException - if the specified provider does not exits.
        NullPointerException - if protocol is null (instead of NoSuchAlgorithmException as in 1.4 release)
      • getInstance

        public static SSLContext getInstance(String protocol,
                             Provider provider)
                                      throws NoSuchAlgorithmException
        Creates a new SSLContext instance for the specified protocol from the specified provider.
        Parameters:
        protocol - the requested protocol to create a context for
        provider - the provider that provides the requested protocol.
        Returns:
        an SSLContext for the requested protocol.
        Throws:
        NoSuchAlgorithmException - if the specified provider cannot provide the requested protocol.
        NullPointerException - if protocol is null (instead of NoSuchAlgorithmException as in 1.4 release)
      • getProtocol

        public final String getProtocol()
        Returns the name of the secure socket protocol of this instance.
        Returns:
        the name of the secure socket protocol of this instance.
      • getProvider

        public final Provider getProvider()
        Returns the provider of this SSLContext instance.
        Returns:
        the provider of this SSLContext instance.
      • init

        public final void init(KeyManager[] km,
                TrustManager[] tm,
                SecureRandom sr)
                        throws KeyManagementException
        Initializes this SSLContext instance. All of the arguments are optional, and the security providers will be searched for the required implementations of the needed algorithms.
        Parameters:
        km - the key sources or null.
        tm - the trust decision sources or null.
        sr - the randomness source or null.
        Throws:
        KeyManagementException - if initializing this instance fails.
      • getSocketFactory

        public final SSLSocketFactory getSocketFactory()
        Returns a socket factory for this instance.
        Returns:
        a socket factory for this instance.
      • getServerSocketFactory

        public final SSLServerSocketFactory getServerSocketFactory()
        Returns a server socket factory for this instance.
        Returns:
        a server socket factory for this instance.
      • createSSLEngine

        public final SSLEngine createSSLEngine()
        Creates an SSLEngine instance from this context.
        Returns:
        an SSLEngine instance from this context.
        Throws:
        UnsupportedOperationException - if the provider does not support the operation.
      • createSSLEngine

        public final SSLEngine createSSLEngine(String peerHost,
                                int peerPort)
        Creates an SSLEngine instance from this context with the specified hostname and port.
        Parameters:
        peerHost - the name of the host
        peerPort - the port
        Returns:
        an SSLEngine instance from this context.
        Throws:
        UnsupportedOperationException - if the provider does not support the operation.
      • getServerSessionContext

        public final SSLSessionContext getServerSessionContext()
        Returns the SSL session context that encapsulates the set of SSL sessions that can be used for handshake of server-side SSL sockets.
        Returns:
        the SSL server session context for this context or null if the underlying provider does not provide an implementation of the SSLSessionContext interface.
      • getClientSessionContext

        public final SSLSessionContext getClientSessionContext()
        Returns the SSL session context that encapsulates the set of SSL sessions that can be used for handshake of client-side SSL sockets.
        Returns:
        the SSL client session context for this context or null if the underlying provider does not provide an implementation of the SSLSessionContext interface.
      • getDefaultSSLParameters

        public final SSLParameters getDefaultSSLParameters()
        Returns the default SSL handshake parameters for SSLSockets created by this SSLContext.
        Throws:
        UnsupportedOperationException
        Since:
        1.6
      • getSupportedSSLParameters

        public final SSLParameters getSupportedSSLParameters()
        Returns SSL handshake parameters for SSLSockets that includes all supported cipher suites and protocols.
        Throws:
        UnsupportedOperationException
        Since:
        1.6


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1037 / . Delta: 0.02643 с