src/java.base/share/classes/javax/net/ssl/SSLContextSpi.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 27,37 ****
import java.security.*;
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
! * for the <code>SSLContext</code> class.
*
* <p> All the abstract methods in this class must be implemented by each
* cryptographic service provider who wishes to supply the implementation
* of a particular SSL context.
*
--- 27,37 ----
import java.security.*;
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
! * for the {@code SSLContext} class.
*
* <p> All the abstract methods in this class must be implemented by each
* cryptographic service provider who wishes to supply the implementation
* of a particular SSL context.
*
*** 50,140 ****
*/
protected abstract void engineInit(KeyManager[] km, TrustManager[] tm,
SecureRandom sr) throws KeyManagementException;
/**
! * Returns a <code>SocketFactory</code> object for this
* context.
*
! * @return the <code>SocketFactory</code> object
* @throws IllegalStateException if the SSLContextImpl requires
! * initialization and the <code>engineInit()</code>
* has not been called
* @see javax.net.ssl.SSLContext#getSocketFactory()
*/
protected abstract SSLSocketFactory engineGetSocketFactory();
/**
! * Returns a <code>ServerSocketFactory</code> object for
* this context.
*
! * @return the <code>ServerSocketFactory</code> object
* @throws IllegalStateException if the SSLContextImpl requires
! * initialization and the <code>engineInit()</code>
* has not been called
* @see javax.net.ssl.SSLContext#getServerSocketFactory()
*/
protected abstract SSLServerSocketFactory engineGetServerSocketFactory();
/**
! * Creates a new <code>SSLEngine</code> using this context.
* <P>
* Applications using this factory method are providing no hints
* for an internal session reuse strategy. If hints are desired,
* {@link #engineCreateSSLEngine(String, int)} should be used
* instead.
* <P>
* Some cipher suites (such as Kerberos) require remote hostname
* information, in which case this factory method should not be used.
*
! * @return the <code>SSLEngine</code> Object
* @throws IllegalStateException if the SSLContextImpl requires
! * initialization and the <code>engineInit()</code>
* has not been called
*
* @see SSLContext#createSSLEngine()
*
* @since 1.5
*/
protected abstract SSLEngine engineCreateSSLEngine();
/**
! * Creates a <code>SSLEngine</code> using this context.
* <P>
* Applications using this factory method are providing hints
* for an internal session reuse strategy.
* <P>
* Some cipher suites (such as Kerberos) require remote hostname
* information, in which case peerHost needs to be specified.
*
* @param host the non-authoritative name of the host
* @param port the non-authoritative port
! * @return the <code>SSLEngine</code> Object
* @throws IllegalStateException if the SSLContextImpl requires
! * initialization and the <code>engineInit()</code>
* has not been called
*
* @see SSLContext#createSSLEngine(String, int)
*
* @since 1.5
*/
protected abstract SSLEngine engineCreateSSLEngine(String host, int port);
/**
! * Returns a server <code>SSLSessionContext</code> object for
* this context.
*
! * @return the <code>SSLSessionContext</code> object
* @see javax.net.ssl.SSLContext#getServerSessionContext()
*/
protected abstract SSLSessionContext engineGetServerSessionContext();
/**
! * Returns a client <code>SSLSessionContext</code> object for
* this context.
*
! * @return the <code>SSLSessionContext</code> object
* @see javax.net.ssl.SSLContext#getClientSessionContext()
*/
protected abstract SSLSessionContext engineGetClientSessionContext();
private SSLSocket getDefaultSocket() {
--- 50,144 ----
*/
protected abstract void engineInit(KeyManager[] km, TrustManager[] tm,
SecureRandom sr) throws KeyManagementException;
/**
! * Returns a {@code SocketFactory} object for this
* context.
*
! * @return the {@code SocketFactory} object
! * @throws UnsupportedOperationException if the underlying provider
! * does not implement the operation.
* @throws IllegalStateException if the SSLContextImpl requires
! * initialization and the {@code engineInit()}
* has not been called
* @see javax.net.ssl.SSLContext#getSocketFactory()
*/
protected abstract SSLSocketFactory engineGetSocketFactory();
/**
! * Returns a {@code ServerSocketFactory} object for
* this context.
*
! * @return the {@code ServerSocketFactory} object
! * @throws UnsupportedOperationException if the underlying provider
! * does not implement the operation.
* @throws IllegalStateException if the SSLContextImpl requires
! * initialization and the {@code engineInit()}
* has not been called
* @see javax.net.ssl.SSLContext#getServerSocketFactory()
*/
protected abstract SSLServerSocketFactory engineGetServerSocketFactory();
/**
! * Creates a new {@code SSLEngine} using this context.
* <P>
* Applications using this factory method are providing no hints
* for an internal session reuse strategy. If hints are desired,
* {@link #engineCreateSSLEngine(String, int)} should be used
* instead.
* <P>
* Some cipher suites (such as Kerberos) require remote hostname
* information, in which case this factory method should not be used.
*
! * @return the {@code SSLEngine} Object
* @throws IllegalStateException if the SSLContextImpl requires
! * initialization and the {@code engineInit()}
* has not been called
*
* @see SSLContext#createSSLEngine()
*
* @since 1.5
*/
protected abstract SSLEngine engineCreateSSLEngine();
/**
! * Creates a {@code SSLEngine} using this context.
* <P>
* Applications using this factory method are providing hints
* for an internal session reuse strategy.
* <P>
* Some cipher suites (such as Kerberos) require remote hostname
* information, in which case peerHost needs to be specified.
*
* @param host the non-authoritative name of the host
* @param port the non-authoritative port
! * @return the {@code SSLEngine} Object
* @throws IllegalStateException if the SSLContextImpl requires
! * initialization and the {@code engineInit()}
* has not been called
*
* @see SSLContext#createSSLEngine(String, int)
*
* @since 1.5
*/
protected abstract SSLEngine engineCreateSSLEngine(String host, int port);
/**
! * Returns a server {@code SSLSessionContext} object for
* this context.
*
! * @return the {@code SSLSessionContext} object
* @see javax.net.ssl.SSLContext#getServerSessionContext()
*/
protected abstract SSLSessionContext engineGetServerSessionContext();
/**
! * Returns a client {@code SSLSessionContext} object for
* this context.
*
! * @return the {@code SSLSessionContext} object
* @see javax.net.ssl.SSLContext#getClientSessionContext()
*/
protected abstract SSLSessionContext engineGetClientSessionContext();
private SSLSocket getDefaultSocket() {