You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by to...@apache.org on 2008/12/18 10:46:26 UTC
svn commit: r727683 [8/11] - in /harmony/enhanced/classlib/branches/java6:
./ doc/ make/ modules/accessibility/src/main/java/javax/accessibility/
modules/archive/src/main/java/java/util/jar/
modules/archive/src/main/java/java/util/zip/ modules/archive/...
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLSocketFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLSocketFactory.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLSocketFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLSocketFactory.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
* limitations under the License.
*/
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.io.IOException;
@@ -33,58 +28,49 @@
*
*/
class DefaultSSLSocketFactory extends SSLSocketFactory {
-
- private String errMessage;
-
+
+ private final String errMessage;
+
+ DefaultSSLSocketFactory(String mes) {
+ errMessage = mes;
+ }
+
+ @Override
public String[] getDefaultCipherSuites() {
return new String[0];
}
+ @Override
public String[] getSupportedCipherSuites() {
return new String[0];
}
- /**
- * @see javax.net.ssl.SSLSocketFactory#createSocket(java.net.Socket, java.lang.String, int, boolean)
- */
- public Socket createSocket(Socket s, String host, int port,
- boolean autoClose) throws IOException {
- throw new SocketException(errMessage);
- }
-
- /**
- * @see javax.net.SocketFactory#createSocket(java.lang.String, int)
- */
- public Socket createSocket(String host, int port) throws IOException,
- UnknownHostException {
- throw new SocketException(errMessage);
- }
-
- /**
- * @see javax.net.SocketFactory#createSocket(java.lang.String, int, java.net.InetAddress, int)
- */
- public Socket createSocket(String host, int port, InetAddress localHost,
- int localPort) throws IOException, UnknownHostException {
- throw new SocketException(errMessage);
- }
-
- /**
- * @see javax.net.SocketFactory#createSocket(java.net.InetAddress, int)
- */
- public Socket createSocket(InetAddress host, int port) throws IOException {
- throw new SocketException(errMessage);
+ @Override
+ public Socket createSocket(Socket s, String host, int port, boolean autoClose)
+ throws IOException {
+ throw new SocketException(errMessage);
}
- /**
- * @see javax.net.SocketFactory#createSocket(java.net.InetAddress, int, java.net.InetAddress, int)
- */
- public Socket createSocket(InetAddress address, int port,
- InetAddress localAddress, int localPort) throws IOException {
- throw new SocketException(errMessage);
+ @Override
+ public Socket createSocket(String host, int port) throws IOException, UnknownHostException {
+ throw new SocketException(errMessage);
}
-
- DefaultSSLSocketFactory(String mes) {
- errMessage = mes;
+
+ @Override
+ public Socket createSocket(String host, int port, InetAddress localHost, int localPort)
+ throws IOException, UnknownHostException {
+ throw new SocketException(errMessage);
+ }
+
+ @Override
+ public Socket createSocket(InetAddress host, int port) throws IOException {
+ throw new SocketException(errMessage);
+ }
+
+ @Override
+ public Socket createSocket(InetAddress address, int port, InetAddress localAddress,
+ int localPort) throws IOException {
+ throw new SocketException(errMessage);
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HandshakeCompletedEvent.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HandshakeCompletedEvent.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HandshakeCompletedEvent.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HandshakeCompletedEvent.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
* limitations under the License.
*/
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.io.Serializable;
@@ -28,17 +23,11 @@
import javax.security.cert.X509Certificate;
import java.util.EventObject;
-/**
- * @com.intel.drl.spec_ref
- *
- */
-public class HandshakeCompletedEvent extends EventObject implements
- Serializable {
+public class HandshakeCompletedEvent extends EventObject implements Serializable {
/**
- * @serial
- * The 5.0 spec. doesn't declare this serialVersionUID field
- * In order to be compatible it is explicitly declared here
+ * The 5.0 spec. doesn't declare this serialVersionUID field In order to be compatible it is
+ * explicitly declared here
*/
private static final long serialVersionUID = 7914963744257769778L;
@@ -61,26 +50,24 @@
return session.getLocalCertificates();
}
- public Certificate[] getPeerCertificates()
- throws SSLPeerUnverifiedException {
+ public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException {
return session.getPeerCertificates();
}
- public X509Certificate[] getPeerCertificateChain()
- throws SSLPeerUnverifiedException {
+ public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException {
return session.getPeerCertificateChain();
}
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
return session.getPeerPrincipal();
}
-
+
public Principal getLocalPrincipal() {
return session.getLocalPrincipal();
}
-
+
public SSLSocket getSocket() {
- return (SSLSocket)this.source;
+ return (SSLSocket) this.source;
}
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HandshakeCompletedListener.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HandshakeCompletedListener.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HandshakeCompletedListener.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HandshakeCompletedListener.java Thu Dec 18 01:46:12 2008
@@ -15,22 +15,10 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.util.EventListener;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public interface HandshakeCompletedListener extends EventListener {
- /**
- * @com.intel.drl.spec_ref
- */
- public void handshakeCompleted(HandshakeCompletedEvent event);
-}
\ No newline at end of file
+ void handshakeCompleted(HandshakeCompletedEvent event);
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HostnameVerifier.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HostnameVerifier.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HostnameVerifier.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HostnameVerifier.java Thu Dec 18 01:46:12 2008
@@ -15,21 +15,8 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public interface HostnameVerifier {
-
- /**
- * @com.intel.drl.spec_ref
- */
- public boolean verify(String hostname, SSLSession session);
-}
\ No newline at end of file
+ boolean verify(String hostname, SSLSession session);
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HttpsURLConnection.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HttpsURLConnection.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HttpsURLConnection.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/HttpsURLConnection.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
* limitations under the License.
*/
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.net.HttpURLConnection;
@@ -28,10 +23,6 @@
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public abstract class HttpsURLConnection extends HttpURLConnection {
private static HostnameVerifier defaultHostnameVerifier = new DefaultHostnameVerifier();
@@ -39,53 +30,60 @@
private static SSLSocketFactory defaultSSLSocketFactory = (SSLSocketFactory) SSLSocketFactory
.getDefault();
+ public static void setDefaultHostnameVerifier(HostnameVerifier v) {
+ if (v == null) {
+ throw new IllegalArgumentException("HostnameVerifier is null");
+ }
+ defaultHostnameVerifier = v;
+ }
+
+ public static HostnameVerifier getDefaultHostnameVerifier() {
+ return defaultHostnameVerifier;
+ }
+
+ public static void setDefaultSSLSocketFactory(SSLSocketFactory sf) {
+ if (sf == null) {
+ throw new IllegalArgumentException("SSLSocketFactory is null");
+ }
+ defaultSSLSocketFactory = sf;
+ }
+
+ public static SSLSocketFactory getDefaultSSLSocketFactory() {
+ return defaultSSLSocketFactory;
+ }
+
protected HostnameVerifier hostnameVerifier;
- private static SSLSocketFactory socketFactory;
+ private SSLSocketFactory sslSocketFactory;
protected HttpsURLConnection(URL url) {
super(url);
hostnameVerifier = defaultHostnameVerifier;
- socketFactory = defaultSSLSocketFactory;
+ sslSocketFactory = defaultSSLSocketFactory;
}
public abstract String getCipherSuite();
public abstract Certificate[] getLocalCertificates();
- public abstract Certificate[] getServerCertificates()
- throws SSLPeerUnverifiedException;
+ public abstract Certificate[] getServerCertificates() throws SSLPeerUnverifiedException;
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
Certificate[] certs = getServerCertificates();
- if (certs == null || certs.length == 0 ||
- (!(certs[0] instanceof X509Certificate))) {
- throw new SSLPeerUnverifiedException(
- "No server's end-entity certificate");
+ if (certs == null || certs.length == 0 || (!(certs[0] instanceof X509Certificate))) {
+ throw new SSLPeerUnverifiedException("No server's end-entity certificate");
}
return ((X509Certificate) certs[0]).getSubjectX500Principal();
}
public Principal getLocalPrincipal() {
Certificate[] certs = getLocalCertificates();
- if (certs == null || certs.length == 0
- || (!(certs[0] instanceof X509Certificate))) {
+ if (certs == null || certs.length == 0 || (!(certs[0] instanceof X509Certificate))) {
return null;
}
return ((X509Certificate) certs[0]).getSubjectX500Principal();
}
- public static void setDefaultHostnameVerifier(HostnameVerifier v) {
- if (v == null) {
- throw new IllegalArgumentException("HostnameVerifier is null");
- }
- defaultHostnameVerifier = v;
- }
-
- public static HostnameVerifier getDefaultHostnameVerifier() {
- return defaultHostnameVerifier;
- }
-
public void setHostnameVerifier(HostnameVerifier v) {
if (v == null) {
throw new IllegalArgumentException("HostnameVerifier is null");
@@ -97,26 +95,15 @@
return hostnameVerifier;
}
- public static void setDefaultSSLSocketFactory(SSLSocketFactory sf) {
- if (sf == null) {
- throw new IllegalArgumentException("SSLSocketFactory is null");
- }
- defaultSSLSocketFactory = sf;
- }
-
- public static SSLSocketFactory getDefaultSSLSocketFactory() {
- return defaultSSLSocketFactory;
- }
-
public void setSSLSocketFactory(SSLSocketFactory sf) {
if (sf == null) {
throw new IllegalArgumentException("SSLSocketFactory is null");
}
- socketFactory = sf;
+ sslSocketFactory = sf;
}
public SSLSocketFactory getSSLSocketFactory() {
- return socketFactory;
+ return sslSocketFactory;
}
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyManager.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyManager.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyManager.java Thu Dec 18 01:46:12 2008
@@ -15,16 +15,7 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public interface KeyManager {
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyManagerFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyManagerFactory.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyManagerFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyManagerFactory.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.security.AccessController;
@@ -28,18 +23,13 @@
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
+import java.security.PrivilegedAction;
import java.security.Provider;
import java.security.Security;
import java.security.UnrecoverableKeyException;
import org.apache.harmony.security.fortress.Engine;
-
-/**
- * @com.intel.drl.spec_ref
- *
- */
-
public class KeyManagerFactory {
// Store KeyManagerFactory service name
private static final String SERVICE = "KeyManagerFactory";
@@ -50,39 +40,18 @@
// Store default property name
private static final String PROPERTY_NAME = "ssl.KeyManagerFactory.algorithm";
- // Store used provider
- private final Provider provider;
-
- // Store used KeyManagerFactorySpi implementation
- private final KeyManagerFactorySpi spiImpl;
-
- // Store used algorithm
- private final String algorithm;
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
- protected KeyManagerFactory(KeyManagerFactorySpi factorySpi,
- Provider provider, String algorithm) {
- this.provider = provider;
- this.algorithm = algorithm;
- this.spiImpl = factorySpi;
- }
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public final String getAlgorithm() {
- return algorithm;
+ public static final String getDefaultAlgorithm() {
+ return AccessController.doPrivileged(new PrivilegedAction<String>() {
+ public String run() {
+ return Security.getProperty(PROPERTY_NAME);
+ }
+ });
}
/**
- * @com.intel.drl.spec_ref
*
- * throws NullPointerException if algorithm is null (instead of
- * NoSuchAlgorithmException as in 1.4 release)
+ * @throws NullPointerException if algorithm is null (instead of NoSuchAlgorithmException as in
+ * 1.4 release)
*/
public static final KeyManagerFactory getInstance(String algorithm)
throws NoSuchAlgorithmException {
@@ -91,20 +60,17 @@
}
synchronized (engine) {
engine.getInstance(algorithm, null);
- return new KeyManagerFactory((KeyManagerFactorySpi) engine.spi,
- engine.provider, algorithm);
+ return new KeyManagerFactory((KeyManagerFactorySpi) engine.spi, engine.provider,
+ algorithm);
}
}
/**
- * @com.intel.drl.spec_ref
- *
- * throws NullPointerException if algorithm is null (instead of
- * NoSuchAlgorithmException as in 1.4 release)
+ * @throws NullPointerException if algorithm is null (instead of NoSuchAlgorithmException as in
+ * 1.4 release)
*/
- public static final KeyManagerFactory getInstance(String algorithm,
- String provider) throws NoSuchAlgorithmException,
- NoSuchProviderException {
+ public static final KeyManagerFactory getInstance(String algorithm, String provider)
+ throws NoSuchAlgorithmException, NoSuchProviderException {
if ((provider == null) || (provider.length() == 0)) {
throw new IllegalArgumentException("Provider is null or empty");
}
@@ -116,13 +82,11 @@
}
/**
- * @com.intel.drl.spec_ref
- *
- * throws NullPointerException if algorithm is null (instead of
- * NoSuchAlgorithmException as in 1.4 release)
+ * @throws NullPointerException if algorithm is null (instead of NoSuchAlgorithmException as in
+ * 1.4 release)
*/
- public static final KeyManagerFactory getInstance(String algorithm,
- Provider provider) throws NoSuchAlgorithmException {
+ public static final KeyManagerFactory getInstance(String algorithm, Provider provider)
+ throws NoSuchAlgorithmException {
if (provider == null) {
throw new IllegalArgumentException("Provider is null");
}
@@ -131,56 +95,44 @@
}
synchronized (engine) {
engine.getInstance(algorithm, provider, null);
- return new KeyManagerFactory((KeyManagerFactorySpi) engine.spi,
- provider, algorithm);
+ return new KeyManagerFactory((KeyManagerFactorySpi) engine.spi, provider, algorithm);
}
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
+ // Store used provider
+ private final Provider provider;
+
+ // Store used KeyManagerFactorySpi implementation
+ private final KeyManagerFactorySpi spiImpl;
+
+ // Store used algorithm
+ private final String algorithm;
+
+ protected KeyManagerFactory(KeyManagerFactorySpi factorySpi, Provider provider, String algorithm) {
+ super();
+ this.provider = provider;
+ this.algorithm = algorithm;
+ this.spiImpl = factorySpi;
+ }
+
+ public final String getAlgorithm() {
+ return algorithm;
+ }
+
public final Provider getProvider() {
return provider;
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public final void init(KeyStore ks, char[] password)
- throws KeyStoreException, NoSuchAlgorithmException,
- UnrecoverableKeyException {
+ public final void init(KeyStore ks, char[] password) throws KeyStoreException,
+ NoSuchAlgorithmException, UnrecoverableKeyException {
spiImpl.engineInit(ks, password);
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public final void init(ManagerFactoryParameters spec)
- throws InvalidAlgorithmParameterException {
+ public final void init(ManagerFactoryParameters spec) throws InvalidAlgorithmParameterException {
spiImpl.engineInit(spec);
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public final KeyManager[] getKeyManagers() {
return spiImpl.engineGetKeyManagers();
}
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public static final String getDefaultAlgorithm() {
- return AccessController
- .doPrivileged(new java.security.PrivilegedAction<String>() {
- public String run() {
- return Security.getProperty(PROPERTY_NAME);
- }
- });
- }
}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyManagerFactorySpi.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyManagerFactorySpi.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyManagerFactorySpi.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyManagerFactorySpi.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.security.InvalidAlgorithmParameterException;
@@ -28,37 +23,17 @@
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
-/**
- * @com.intel.drl.spec_ref
- *
- */
-
public abstract class KeyManagerFactorySpi {
- /**
- * @com.intel.drl.spec_ref
- *
- */
+
public KeyManagerFactorySpi() {
+ super();
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
- protected abstract void engineInit(KeyStore ks, char[] password)
- throws KeyStoreException, NoSuchAlgorithmException,
- UnrecoverableKeyException;
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
+ protected abstract void engineInit(KeyStore ks, char[] password) throws KeyStoreException,
+ NoSuchAlgorithmException, UnrecoverableKeyException;
+
protected abstract void engineInit(ManagerFactoryParameters spec)
throws InvalidAlgorithmParameterException;
- /**
- * @com.intel.drl.spec_ref
- *
- */
protected abstract KeyManager[] engineGetKeyManagers();
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java Thu Dec 18 01:46:12 2008
@@ -23,31 +23,52 @@
import java.security.KeyStore;
/**
- * @com.intel.drl.spec_ref
- *
+ * A parameters object for {@link X509KeyManager}
+ *
+ * @since 1.5
+ * @see X509KeyManager
+ * @see KeyStore.Builder
*/
public class KeyStoreBuilderParameters implements ManagerFactoryParameters {
- private List ksbuilders;
+ private final List<KeyStore.Builder> ksbuilders;
+ /**
+ * Constructs an instance for the builder passed.
+ *
+ * @param builder a builder
+ */
public KeyStoreBuilderParameters(KeyStore.Builder builder) {
- ksbuilders = new ArrayList();
- if (builder != null) {
- ksbuilders.add(builder);
- }
+ super();
+ ksbuilders = Collections.singletonList(builder);
}
+ /**
+ * Constructs an instance for the builder list passed.
+ *
+ * @param parameters the builder list
+ * @throws NullPointerException if {@code parameters} is {@code null}
+ * @throws IllegalArgumentException if {@code parameters} is empty
+ */
+ @SuppressWarnings("unchecked")
public KeyStoreBuilderParameters(List parameters) {
+ super();
if (parameters == null) {
throw new NullPointerException("Builders list is null");
}
if (parameters.isEmpty()) {
throw new IllegalArgumentException("Builders list is empty");
}
- ksbuilders = new ArrayList(parameters);
+ ksbuilders = Collections.unmodifiableList(new ArrayList<KeyStore.Builder>(parameters));
}
+ /**
+ * The list of builder parameters.
+ *
+ * @return an unmodifiable list of parameters
+ */
+ @SuppressWarnings("unchecked")
public List getParameters() {
- return Collections.unmodifiableList(ksbuilders);
+ return ksbuilders;
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/ManagerFactoryParameters.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/ManagerFactoryParameters.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/ManagerFactoryParameters.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/ManagerFactoryParameters.java Thu Dec 18 01:46:12 2008
@@ -15,16 +15,12 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
/**
- * @com.intel.drl.spec_ref
+ * Common interface for passing parameters to manager factory objects.
*
+ * @since 1.4
*/
public interface ManagerFactoryParameters {
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLContext.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLContext.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLContext.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLContext.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.security.AccessController;
@@ -33,12 +28,6 @@
import org.apache.harmony.security.fortress.Engine;
-
-/**
- * @com.intel.drl.spec_ref
- *
- */
-
public class SSLContext {
// StoreSSLContext service name
private static final String SERVICE = "SSLContext";
@@ -46,50 +35,25 @@
// Used to access common engine functionality
private static Engine engine = new Engine(SERVICE);
- // Storeused provider
- private final Provider provider;
-
- private static SSLContext defaultSSLContext;
- // Storeused SSLContextSpi implementation
- private final SSLContextSpi spiImpl;
-
- // Storeused protocol
- private final String protocol;
-
- /*
- * @com.intel.drl.spec_ref
- *
- */
- protected SSLContext(SSLContextSpi contextSpi, Provider provider,
- String protocol) {
- this.provider = provider;
- this.protocol = protocol;
- this.spiImpl = contextSpi;
- }
-
/**
- * @com.intel.drl.spec_ref
*
- * throws NullPointerException if protocol is null (instead of
- * NoSuchAlgorithmException as in 1.4 release)
+ * @throws NullPointerException if protocol is null (instead of NoSuchAlgorithmException as in
+ * 1.4 release)
*/
- public static SSLContext getInstance(String protocol)
- throws NoSuchAlgorithmException {
+ public static SSLContext getInstance(String protocol) throws NoSuchAlgorithmException {
if (protocol == null) {
throw new NullPointerException("protocol is null");
}
synchronized (engine) {
engine.getInstance(protocol, null);
- return new SSLContext((SSLContextSpi) engine.spi, engine.provider,
- protocol);
+ return new SSLContext((SSLContextSpi) engine.spi, engine.provider, protocol);
}
}
/**
- * @com.intel.drl.spec_ref
*
- * throws NullPointerException if protocol is null (instead of
- * NoSuchAlgorithmException as in 1.4 release)
+ * @throws NullPointerException if protocol is null (instead of NoSuchAlgorithmException as in
+ * 1.4 release)
*/
public static SSLContext getInstance(String protocol, String provider)
throws NoSuchAlgorithmException, NoSuchProviderException {
@@ -107,10 +71,8 @@
}
/**
- * @com.intel.drl.spec_ref
- *
- * throws NullPointerException if protocol is null (instead of
- * NoSuchAlgorithmException as in 1.4 release)
+ * @throws NullPointerException if protocol is null (instead of NoSuchAlgorithmException as in
+ * 1.4 release)
*/
public static SSLContext getInstance(String protocol, Provider provider)
throws NoSuchAlgorithmException {
@@ -126,101 +88,52 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
+ private final Provider provider;
+
+ private final SSLContextSpi spiImpl;
+
+ private final String protocol;
+
+ protected SSLContext(SSLContextSpi contextSpi, Provider provider, String protocol) {
+ this.provider = provider;
+ this.protocol = protocol;
+ this.spiImpl = contextSpi;
+ }
+
public final String getProtocol() {
return protocol;
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public final Provider getProvider() {
return provider;
}
- /**
- * @com.intel.drl.spec_ref
- *
- * FIXME: check what exception will be thrown when parameters are null
- */
public final void init(KeyManager[] km, TrustManager[] tm, SecureRandom sr)
throws KeyManagementException {
spiImpl.engineInit(km, tm, sr);
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public final SSLSocketFactory getSocketFactory() {
return spiImpl.engineGetSocketFactory();
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public final SSLServerSocketFactory getServerSocketFactory() {
return spiImpl.engineGetServerSocketFactory();
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public final SSLEngine createSSLEngine() {
return spiImpl.engineCreateSSLEngine();
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public final SSLEngine createSSLEngine(String peerHost, int peerPort) {
return spiImpl.engineCreateSSLEngine(peerHost, peerPort);
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public final SSLSessionContext getServerSessionContext() {
return spiImpl.engineGetServerSessionContext();
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public final SSLSessionContext getClientSessionContext() {
return spiImpl.engineGetClientSessionContext();
}
-
- public final SSLParameters getDefaultSSLParameters() {
- return spiImpl.engineGetDefaultSSLParameters();
- }
-
- public final SSLParameters getSupportedSSLParameters() {
- return spiImpl.engineGetSupportedSSLParameters();
- }
-
- public static SSLContext getDefault() throws NoSuchAlgorithmException {
- if (defaultSSLContext == null)
- defaultSSLContext = SSLContext.getInstance("Default");
- return defaultSSLContext;
- }
-
- public static void setDefault(SSLContext sslContext) {
- if (sslContext == null)
- throw new NullPointerException();
- SecurityManager securityManager = System.getSecurityManager();
- if (securityManager != null)
- securityManager.checkPermission(new SSLPermission(
- "setDefaultSSLContext"));
- defaultSSLContext = sslContext;
- }
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLContextSpi.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLContextSpi.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLContextSpi.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLContextSpi.java Thu Dec 18 01:46:12 2008
@@ -15,131 +15,29 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
-import java.io.IOException;
import java.security.KeyManagementException;
import java.security.SecureRandom;
-import javax.net.SocketFactory;
-
-/**
- * @com.intel.drl.spec_ref
- *
- */
-
public abstract class SSLContextSpi {
- /**
- * @com.intel.drl.spec_ref
- *
- */
public SSLContextSpi() {
+ super();
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
- protected abstract void engineInit(KeyManager[] km, TrustManager[] tm,
- SecureRandom sr) throws KeyManagementException;
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
+ protected abstract void engineInit(KeyManager[] km, TrustManager[] tm, SecureRandom sr)
+ throws KeyManagementException;
+
protected abstract SSLSocketFactory engineGetSocketFactory();
- /**
- * @com.intel.drl.spec_ref
- *
- */
protected abstract SSLServerSocketFactory engineGetServerSocketFactory();
- /**
- * @com.intel.drl.spec_ref
- *
- */
protected abstract SSLEngine engineCreateSSLEngine(String host, int port);
- /**
- * @com.intel.drl.spec_ref
- *
- */
protected abstract SSLEngine engineCreateSSLEngine();
- /**
- * @com.intel.drl.spec_ref
- *
- */
protected abstract SSLSessionContext engineGetServerSessionContext();
- /**
- * @com.intel.drl.spec_ref
- *
- */
protected abstract SSLSessionContext engineGetClientSessionContext();
- protected SSLParameters engineGetDefaultSSLParameters() {
- // Initially, a default set of cipher suites will be enabled on a new
- // socket that represents the minimum suggested configuration
- SSLParameters defaultSSLParameters = new SSLParameters();
- SocketFactory sslSocketFactory = SSLSocketFactory.getDefault();
- SSLSocket sslSocket = null;
- try {
- sslSocket = (SSLSocket) sslSocketFactory.createSocket();
- if (sslSocket == null)
- return null;
- defaultSSLParameters.setCipherSuites(sslSocket
- .getEnabledCipherSuites());
- defaultSSLParameters.setProtocols(sslSocket.getEnabledProtocols());
- } catch (IOException e1) {
- e1.printStackTrace();
- throw new UnsupportedOperationException(
- "the default SSL parameters could not be obtained");
- } finally {
- try {
- if (sslSocket != null) {
- sslSocket.close();
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- return defaultSSLParameters;
- };
-
- protected SSLParameters engineGetSupportedSSLParameters() {
- SSLParameters supportSSLParameters = new SSLParameters();
- SocketFactory sslSocketFactory = SSLSocketFactory.getDefault();
- if (sslSocketFactory == null)
- return null;
- SSLSocket sslSocket = null;
- try {
- sslSocket = (SSLSocket) sslSocketFactory.createSocket();
- if (sslSocket == null)
- return null;
- supportSSLParameters.setCipherSuites(sslSocket
- .getSupportedCipherSuites());
- supportSSLParameters
- .setProtocols(sslSocket.getSupportedProtocols());
- } catch (IOException e1) {
- e1.printStackTrace();
- throw new UnsupportedOperationException(
- "the supported SSL parameters could not be obtained");
- } finally {
- try {
- if (sslSocket != null) {
- sslSocket.close();
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- return supportSSLParameters;
- };
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLEngine.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLEngine.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLEngine.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLEngine.java Thu Dec 18 01:46:12 2008
@@ -15,302 +15,140 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.nio.ByteBuffer;
-import java.nio.ReadOnlyBufferException;
/**
+ * An engine for securing communication via SSL, TLS and other protocols.
*
- * @com.intel.drl.spec_ref
- *
- *
+ * @since 1.5
*/
public abstract class SSLEngine {
- // Store host value
- private final String host;
-
- // Store port value
- private final int port;
+ private final String peerHost;
+ private final int peerPort;
/**
- * @com.intel.drl.spec_ref
- *
+ * Constructs an instance without any peer host information.
*/
protected SSLEngine() {
- host = null;
- port = -1;
+ super();
+ peerHost = null;
+ peerPort = -1;
}
/**
- * @com.intel.drl.spec_ref
- *
+ * Constructs an instance with the given peer host and port.
+ *
+ * @param host name of the peer host
+ * @param port value of the port of the peer host
*/
protected SSLEngine(String host, int port) {
- this.host = host;
- this.port = port;
+ super();
+ this.peerHost = host;
+ this.peerPort = port;
+ }
+
+ public String getPeerHost() {
+ return peerHost;
+ }
+
+ public int getPeerPort() {
+ return peerPort;
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract void beginHandshake() throws SSLException;
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract void closeInbound() throws SSLException;
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract void closeOutbound();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract Runnable getDelegatedTask();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract String[] getEnabledCipherSuites();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract String[] getEnabledProtocols();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract boolean getEnableSessionCreation();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract SSLEngineResult.HandshakeStatus getHandshakeStatus();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract boolean getNeedClientAuth();
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public String getPeerHost() {
- return host;
- }
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public int getPeerPort() {
- return port;
- }
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract SSLSession getSession();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract String[] getSupportedCipherSuites();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract String[] getSupportedProtocols();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract boolean getUseClientMode();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract boolean getWantClientAuth();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract boolean isInboundDone();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract boolean isOutboundDone();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract void setEnabledCipherSuites(String[] suites);
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract void setEnabledProtocols(String[] protocols);
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract void setEnableSessionCreation(boolean flag);
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract void setNeedClientAuth(boolean need);
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract void setUseClientMode(boolean mode);
- /**
- * @com.intel.drl.spec_ref
- *
- */
public abstract void setWantClientAuth(boolean want);
- public abstract void setSSLParameters(SSLParameters sslP);
-
- public abstract SSLParameters getSSLParameters();
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public abstract SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts,
- int offset, int length) throws SSLException;
+ public abstract SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts, int offset, int length)
+ throws SSLException;
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public abstract SSLEngineResult wrap(ByteBuffer[] srcs, int offset,
- int length, ByteBuffer dst) throws SSLException;
+ public abstract SSLEngineResult wrap(ByteBuffer[] srcs, int offset, int length, ByteBuffer dst)
+ throws SSLException;
/**
- * implementation behavior follows RI:
- * jdk 1.5 does not throw IllegalArgumentException when parameters are null
- * and does not throw ReadOnlyBufferException if dst is read only byte buffer
- *
+ * implementation behavior follows RI: jdk 1.5 does not throw IllegalArgumentException when
+ * parameters are null and does not throw ReadOnlyBufferException if dst is read only byte
+ * buffer
+ *
*/
- public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer dst)
- throws SSLException {
-// if (src == null) {
-// throw new IllegalArgumentException("Byte buffer src is null");
-// }
-// if (dst == null) {
-// throw new IllegalArgumentException("Byte buffer dst is null");
-// }
-// if (dst.isReadOnly()) {
-// throw new ReadOnlyBufferException();
-// }
+ public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer dst) throws SSLException {
return unwrap(src, new ByteBuffer[] { dst }, 0, 1);
}
/**
- * implementation behavior follows RI:
- * jdk 1.5 does not throw IllegalArgumentException when src is null or if
- * dsts contains null elements
- * It does not throw ReadOnlyBufferException when dsts contains read only elements
+ * implementation behavior follows RI: jdk 1.5 does not throw IllegalArgumentException when src
+ * is null or if dsts contains null elements It does not throw ReadOnlyBufferException when dsts
+ * contains read only elements
*/
- public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts)
- throws SSLException {
-// if (src == null) {
-// throw new IllegalArgumentException("Byte buffer src is null");
-// }
+ public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts) throws SSLException {
if (dsts == null) {
throw new IllegalArgumentException("Byte buffer array dsts is null");
}
-// for (int i = 0; i < dsts.length; i++) {
-// if (dsts[i] == null) {
-// throw new IllegalArgumentException("Byte buffer dsts[" + i
-// + "] is null");
-// }
-// if (dsts[i].isReadOnly()) {
-// throw new ReadOnlyBufferException();
-// }
-// }
return unwrap(src, dsts, 0, dsts.length);
}
/**
- * implementation behavior follows RI: jdk 1.5 does not throw
- * IllegalArgumentException when dst is null or if srcs contains null
- * elements It does not throw ReadOnlyBufferException for read only dst
- *
+ * implementation behavior follows RI: jdk 1.5 does not throw IllegalArgumentException when dst
+ * is null or if srcs contains null elements It does not throw ReadOnlyBufferException for read
+ * only dst
+ *
*/
- public SSLEngineResult wrap(ByteBuffer[] srcs, ByteBuffer dst)
- throws SSLException {
+ public SSLEngineResult wrap(ByteBuffer[] srcs, ByteBuffer dst) throws SSLException {
if (srcs == null) {
throw new IllegalArgumentException("Byte buffer array srcs is null");
}
-// for (int i = 0; i < srcs.length; i++) {
-// if (srcs[i] == null) {
-// throw new IllegalArgumentException("Byte buffer srcs[" + i
-// + "] is null");
-// }
-// }
-// if (dst == null) {
-// throw new IllegalArgumentException("Byte buffer array dst is null");
-// }
-// if (dst.isReadOnly()) {
-// throw new ReadOnlyBufferException();
-// }
return wrap(srcs, 0, srcs.length, dst);
}
/**
- * implementation behavior follows RI:
- * jdk 1.5 does not throw IllegalArgumentException when parameters are null
- * and does not throw ReadOnlyBufferException if dst is read only byte buffer
- *
+ * implementation behavior follows RI: jdk 1.5 does not throw IllegalArgumentException when
+ * parameters are null and does not throw ReadOnlyBufferException if dst is read only byte
+ * buffer
+ *
*/
- public SSLEngineResult wrap(ByteBuffer src, ByteBuffer dst)
- throws SSLException {
-// if (src == null) {
-// throw new IllegalArgumentException("Byte buffer src is null");
-// }
-// if (dst == null) {
-// throw new IllegalArgumentException("Byte buffer dst is null");
-// }
-// if (dst.isReadOnly()) {
-// throw new ReadOnlyBufferException();
-// }
+ public SSLEngineResult wrap(ByteBuffer src, ByteBuffer dst) throws SSLException {
return wrap(new ByteBuffer[] { src }, 0, 1, dst);
}
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLEngineResult.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLEngineResult.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLEngineResult.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLEngineResult.java Thu Dec 18 01:46:12 2008
@@ -15,19 +15,18 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public class SSLEngineResult {
-
+
+ public enum HandshakeStatus {
+ NOT_HANDSHAKING, FINISHED, NEED_TASK, NEED_WRAP, NEED_UNWRAP
+ }
+
+ public static enum Status {
+ BUFFER_OVERFLOW, BUFFER_UNDERFLOW, CLOSED, OK
+ }
+
// Store Status object
private final SSLEngineResult.Status status;
@@ -40,12 +39,8 @@
// Store bytesProduced
private final int bytesProduced;
- /**
- * @com.intel.drl.spec_ref
- */
public SSLEngineResult(SSLEngineResult.Status status,
- SSLEngineResult.HandshakeStatus handshakeStatus, int bytesConsumed,
- int bytesProduced) {
+ SSLEngineResult.HandshakeStatus handshakeStatus, int bytesConsumed, int bytesProduced) {
if (status == null) {
throw new IllegalArgumentException("status is null");
}
@@ -64,67 +59,26 @@
this.bytesProduced = bytesProduced;
}
- /**
- * @com.intel.drl.spec_ref
- */
public final Status getStatus() {
return status;
}
- /**
- * @com.intel.drl.spec_ref
- */
public final HandshakeStatus getHandshakeStatus() {
return handshakeStatus;
}
- /**
- * @com.intel.drl.spec_ref
- */
public final int bytesConsumed() {
return bytesConsumed;
}
- /**
- * @com.intel.drl.spec_ref
- */
public final int bytesProduced() {
return bytesProduced;
}
- /**
- * @com.intel.drl.spec_ref
- */
+ @Override
public String toString() {
- StringBuffer sb = new StringBuffer("SSLEngineReport: Status = ");
- sb.append(status.toString());
- sb.append(" HandshakeStatus = ");
- sb.append(handshakeStatus.toString());
- sb.append("\n bytesConsumed = ");
- sb.append(Integer.toString(bytesConsumed));
- sb.append(" bytesProduced = ");
- sb.append(Integer.toString(bytesProduced));
- return sb.toString();
- }
-
- /**
- * @com.intel.drl.spec_ref
- */
- public enum HandshakeStatus {
- NOT_HANDSHAKING,
- FINISHED,
- NEED_TASK,
- NEED_WRAP,
- NEED_UNWRAP
- }
-
- /**
- * @com.intel.drl.spec_ref
- */
- public static enum Status {
- BUFFER_OVERFLOW,
- BUFFER_UNDERFLOW,
- CLOSED,
- OK
+ return "SSLEngineReport: Status = " + status + " HandshakeStatus = " + handshakeStatus
+ + "\n bytesConsumed = " + bytesConsumed + " bytesProduced = "
+ + bytesProduced;
}
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLException.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLException.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLException.java Thu Dec 18 01:46:12 2008
@@ -15,47 +15,22 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.io.IOException;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public class SSLException extends IOException {
- /**
- * @com.intel.drl.spec_ref
- * @serial
- */
private static final long serialVersionUID = 4511006460650708967L;
- /**
- * @com.intel.drl.spec_ref
- *
- */
public SSLException(String reason) {
super(reason);
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public SSLException(String message, Throwable cause) {
super(message);
super.initCause(cause);
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public SSLException(Throwable cause) {
super(cause == null ? null : cause.toString());
super.initCause(cause);
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLHandshakeException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLHandshakeException.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLHandshakeException.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLHandshakeException.java Thu Dec 18 01:46:12 2008
@@ -15,26 +15,13 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public class SSLHandshakeException extends SSLException {
-
+
private static final long serialVersionUID = -5045881315018326890L;
- /**
- * @com.intel.drl.spec_ref
- *
- */
public SSLHandshakeException(String reason) {
super(reason);
}
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLKeyException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLKeyException.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLKeyException.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLKeyException.java Thu Dec 18 01:46:12 2008
@@ -15,26 +15,13 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public class SSLKeyException extends SSLException {
private static final long serialVersionUID = -8071664081941937874L;
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
+
public SSLKeyException(String reason) {
super(reason);
}
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLPeerUnverifiedException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLPeerUnverifiedException.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLPeerUnverifiedException.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLPeerUnverifiedException.java Thu Dec 18 01:46:12 2008
@@ -15,26 +15,13 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public class SSLPeerUnverifiedException extends SSLException {
-
+
private static final long serialVersionUID = -8919512675000600547L;
- /**
- * @com.intel.drl.spec_ref
- *
- */
public SSLPeerUnverifiedException(String reason) {
super(reason);
}
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLPermission.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLPermission.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLPermission.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLPermission.java Thu Dec 18 01:46:12 2008
@@ -15,23 +15,14 @@
* limitations under the License.
*/
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.security.BasicPermission;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public final class SSLPermission extends BasicPermission {
-
+
private static final long serialVersionUID = -3456898025505876775L;
-
+
public SSLPermission(String name) {
super(name);
}
@@ -39,4 +30,4 @@
public SSLPermission(String name, String actions) {
super(name, actions);
}
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLProtocolException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLProtocolException.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLProtocolException.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLProtocolException.java Thu Dec 18 01:46:12 2008
@@ -15,26 +15,13 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public class SSLProtocolException extends SSLException {
-
+
private static final long serialVersionUID = 5445067063799134928L;
- /**
- * @com.intel.drl.spec_ref
- *
- */
public SSLProtocolException(String reason) {
super(reason);
}
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLServerSocket.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLServerSocket.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLServerSocket.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLServerSocket.java Thu Dec 18 01:46:12 2008
@@ -15,22 +15,14 @@
* limitations under the License.
*/
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public abstract class SSLServerSocket extends ServerSocket {
+
protected SSLServerSocket() throws IOException {
super();
}
@@ -43,23 +35,35 @@
super(port, backlog);
}
- protected SSLServerSocket(int port, int backlog, InetAddress address)
- throws IOException {
+ protected SSLServerSocket(int port, int backlog, InetAddress address) throws IOException {
super(port, backlog, address);
}
-
+
public abstract String[] getEnabledCipherSuites();
+
public abstract void setEnabledCipherSuites(String[] suites);
+
public abstract String[] getSupportedCipherSuites();
+
public abstract String[] getSupportedProtocols();
+
public abstract String[] getEnabledProtocols();
+
public abstract void setEnabledProtocols(String[] protocols);
+
public abstract void setNeedClientAuth(boolean need);
+
public abstract boolean getNeedClientAuth();
+
public abstract void setWantClientAuth(boolean want);
+
public abstract boolean getWantClientAuth();
+
public abstract void setUseClientMode(boolean mode);
+
public abstract boolean getUseClientMode();
+
public abstract void setEnableSessionCreation(boolean flag);
+
public abstract boolean getEnableSessionCreation();
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLServerSocketFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLServerSocketFactory.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLServerSocketFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLServerSocketFactory.java Thu Dec 18 01:46:12 2008
@@ -15,53 +15,39 @@
* limitations under the License.
*/
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.security.Security;
import javax.net.ServerSocketFactory;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public abstract class SSLServerSocketFactory extends ServerSocketFactory {
-// TODO EXPORT CONTROL
-
+ // TODO EXPORT CONTROL
+
// The default SSL socket factory
private static ServerSocketFactory defaultServerSocketFactory;
private static String defaultName;
-
- protected SSLServerSocketFactory() {
- super();
- }
- public static ServerSocketFactory getDefault() {
+ public static synchronized ServerSocketFactory getDefault() {
if (defaultServerSocketFactory != null) {
return defaultServerSocketFactory;
}
if (defaultName == null) {
- AccessController.doPrivileged(new java.security.PrivilegedAction(){
- public Object run() {
- defaultName = Security.getProperty("ssl.ServerSocketFactory.provider");
- if (defaultName != null) {
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ public Void run() {
+ defaultName = Security.getProperty("ssl.ServerSocketFactory.provider");
+ if (defaultName != null) {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null) {
cl = ClassLoader.getSystemClassLoader();
}
try {
- defaultServerSocketFactory = (ServerSocketFactory) Class
- .forName(defaultName, true, cl)
- .newInstance();
+ final Class<?> ssfc = Class.forName(defaultName, true, cl);
+ defaultServerSocketFactory = (ServerSocketFactory) ssfc.newInstance();
} catch (Exception e) {
- return e;
}
}
return null;
@@ -72,17 +58,22 @@
// Try to find in providers
SSLContext context = DefaultSSLContext.getContext();
if (context != null) {
- defaultServerSocketFactory = context.getServerSocketFactory();
+ defaultServerSocketFactory = context.getServerSocketFactory();
}
}
if (defaultServerSocketFactory == null) {
// Use internal dummy implementation
- defaultServerSocketFactory = new DefaultSSLServerSocketFactory("No ServerSocketFactory installed");
- }
+ defaultServerSocketFactory = new DefaultSSLServerSocketFactory(
+ "No ServerSocketFactory installed");
+ }
return defaultServerSocketFactory;
}
-
+
+ protected SSLServerSocketFactory() {
+ super();
+ }
+
public abstract String[] getDefaultCipherSuites();
- public abstract String[] getSupportedCipherSuites();
+ public abstract String[] getSupportedCipherSuites();
}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSession.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSession.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSession.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSession.java Thu Dec 18 01:46:12 2008
@@ -15,148 +15,53 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.security.Principal;
import java.security.cert.Certificate;
import javax.security.cert.X509Certificate;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public interface SSLSession {
- /**
- * @com.intel.drl.spec_ref
- *
- */
public int getApplicationBufferSize();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public String getCipherSuite();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public long getCreationTime();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public byte[] getId();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public long getLastAccessedTime();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public Certificate[] getLocalCertificates();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public Principal getLocalPrincipal();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public int getPacketBufferSize();
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public X509Certificate[] getPeerCertificateChain()
- throws SSLPeerUnverifiedException;
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public Certificate[] getPeerCertificates()
- throws SSLPeerUnverifiedException;
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
+ public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException;
+
+ public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException;
+
public String getPeerHost();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public int getPeerPort();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException;
- /**
- * @com.intel.drl.spec_ref
- *
- */
public String getProtocol();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public SSLSessionContext getSessionContext();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public Object getValue(String name);
- /**
- * @com.intel.drl.spec_ref
- *
- */
public String[] getValueNames();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public void invalidate();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public boolean isValid();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public void putValue(String name, Object value);
- /**
- * @com.intel.drl.spec_ref
- *
- */
public void removeValue(String name);
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSessionBindingEvent.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSessionBindingEvent.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSessionBindingEvent.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSessionBindingEvent.java Thu Dec 18 01:46:12 2008
@@ -15,42 +15,35 @@
* limitations under the License.
*/
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.io.Serializable;
import java.util.EventObject;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public class SSLSessionBindingEvent extends EventObject implements Serializable {
/**
- * @serial
- * The 5.0 spec. doesn't declare this serialVersionUID field
- * In order to be compatible it is explicitly declared here
+ * The 5.0 spec. doesn't declare this serialVersionUID field In order to be compatible it is
+ * explicitly declared here
*/
private static final long serialVersionUID = 3989172637106345L;
- private String name;
+ /**
+ * @serial include
+ */
+ private final String name;
public SSLSessionBindingEvent(SSLSession session, String name) {
super(session);
this.name = name;
}
+
public String getName() {
return name;
}
+
public SSLSession getSession() {
- return (SSLSession)this.source;
+ return (SSLSession) this.source;
}
-
-
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSessionBindingListener.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSessionBindingListener.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSessionBindingListener.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSessionBindingListener.java Thu Dec 18 01:46:12 2008
@@ -15,31 +15,14 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.util.EventListener;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public interface SSLSessionBindingListener extends EventListener {
- /**
- * @com.intel.drl.spec_ref
- *
- */
public void valueBound(SSLSessionBindingEvent event);
- /**
- * @com.intel.drl.spec_ref
- *
- */
public void valueUnbound(SSLSessionBindingEvent event);
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSessionContext.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSessionContext.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSessionContext.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSessionContext.java Thu Dec 18 01:46:12 2008
@@ -15,54 +15,21 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.util.Enumeration;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public interface SSLSessionContext {
- /**
- * @com.intel.drl.spec_ref
- *
- */
+ @SuppressWarnings("unchecked")
public Enumeration getIds();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public SSLSession getSession(byte[] sessionId);
- /**
- * @com.intel.drl.spec_ref
- *
- */
public int getSessionCacheSize();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public int getSessionTimeout();
- /**
- * @com.intel.drl.spec_ref
- *
- */
public void setSessionCacheSize(int size) throws IllegalArgumentException;
- /**
- * @com.intel.drl.spec_ref
- *
- */
public void setSessionTimeout(int seconds) throws IllegalArgumentException;
-
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSocket.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSocket.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSocket.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSocket.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
* limitations under the License.
*/
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.io.IOException;
@@ -27,17 +22,13 @@
import java.net.Socket;
import java.net.UnknownHostException;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public abstract class SSLSocket extends Socket {
+
protected SSLSocket() {
super();
}
- protected SSLSocket(String host, int port) throws IOException,
- UnknownHostException {
+ protected SSLSocket(String host, int port) throws IOException, UnknownHostException {
super(host, port);
}
@@ -45,37 +36,50 @@
super(address, port);
}
- protected SSLSocket(String host, int port, InetAddress clientAddress,
- int clientPort) throws IOException, UnknownHostException {
+ protected SSLSocket(String host, int port, InetAddress clientAddress, int clientPort)
+ throws IOException, UnknownHostException {
super(host, port, clientAddress, clientPort);
}
- protected SSLSocket(InetAddress address, int port,
- InetAddress clientAddress, int clientPort) throws IOException {
+ protected SSLSocket(InetAddress address, int port, InetAddress clientAddress, int clientPort)
+ throws IOException {
super(address, port, clientAddress, clientPort);
}
-
+
public abstract String[] getSupportedCipherSuites();
+
public abstract String[] getEnabledCipherSuites();
+
public abstract void setEnabledCipherSuites(String[] suites);
+
public abstract String[] getSupportedProtocols();
+
public abstract String[] getEnabledProtocols();
+
public abstract void setEnabledProtocols(String[] protocols);
+
public abstract SSLSession getSession();
+
public abstract void addHandshakeCompletedListener(HandshakeCompletedListener listener);
+
public abstract void removeHandshakeCompletedListener(HandshakeCompletedListener listener);
+
public abstract void startHandshake() throws IOException;
+
public abstract void setUseClientMode(boolean mode);
+
public abstract boolean getUseClientMode();
+
public abstract void setNeedClientAuth(boolean need);
+
public abstract boolean getNeedClientAuth();
+
public abstract void setWantClientAuth(boolean want);
- public abstract boolean getWantClientAuth();
- public abstract void setEnableSessionCreation(boolean flag);
- public abstract void setSSLParameters(SSLParameters inputSSLParameters);
- public abstract SSLParameters getSSLParameters();
+ public abstract boolean getWantClientAuth();
- public abstract boolean getEnableSessionCreation();
+ public abstract void setEnableSessionCreation(boolean flag);
-}
\ No newline at end of file
+ public abstract boolean getEnableSessionCreation();
+
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSocketFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSocketFactory.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSocketFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/SSLSocketFactory.java Thu Dec 18 01:46:12 2008
@@ -15,24 +15,16 @@
* limitations under the License.
*/
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.io.IOException;
import java.net.Socket;
import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.security.Security;
import javax.net.SocketFactory;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public abstract class SSLSocketFactory extends SocketFactory {
// FIXME EXPORT CONTROL
@@ -41,28 +33,23 @@
private static String defaultName;
- public SSLSocketFactory() {
- super();
- }
-
- public static SocketFactory getDefault() {
+ public static synchronized SocketFactory getDefault() {
if (defaultSocketFactory != null) {
return defaultSocketFactory;
}
if (defaultName == null) {
- AccessController.doPrivileged(new java.security.PrivilegedAction(){
- public Object run() {
- defaultName = Security.getProperty("ssl.SocketFactory.provider");
- if (defaultName != null) {
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ public Void run() {
+ defaultName = Security.getProperty("ssl.SocketFactory.provider");
+ if (defaultName != null) {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null) {
cl = ClassLoader.getSystemClassLoader();
}
try {
- defaultSocketFactory = (SocketFactory) Class.forName(
- defaultName, true, cl).newInstance();
- } catch (Exception e) {
- return e;
+ final Class<?> sfc = Class.forName(defaultName, true, cl);
+ defaultSocketFactory = (SocketFactory) sfc.newInstance();
+ } catch (Exception e) {
}
}
return null;
@@ -84,11 +71,14 @@
return defaultSocketFactory;
}
+ public SSLSocketFactory() {
+ super();
+ }
+
public abstract String[] getDefaultCipherSuites();
public abstract String[] getSupportedCipherSuites();
- public abstract Socket createSocket(Socket s, String host, int port,
- boolean autoClose) throws IOException;
-
-}
\ No newline at end of file
+ public abstract Socket createSocket(Socket s, String host, int port, boolean autoClose)
+ throws IOException;
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/TrustManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/TrustManager.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/TrustManager.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/TrustManager.java Thu Dec 18 01:46:12 2008
@@ -15,16 +15,7 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
-/**
- * @com.intel.drl.spec_ref
- *
- */
public interface TrustManager {
-}
\ No newline at end of file
+}
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactory.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/javax/net/ssl/TrustManagerFactory.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
* limitations under the License.
*/
-/**
-* @author Vera Y. Petrashkova
-* @version $Revision$
-*/
-
package javax.net.ssl;
import java.security.AccessController;
@@ -28,17 +23,12 @@
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
+import java.security.PrivilegedAction;
import java.security.Provider;
import java.security.Security;
import org.apache.harmony.security.fortress.Engine;
-
-/**
- * @com.intel.drl.spec_ref
- *
- */
-
public class TrustManagerFactory {
// Store TrustManager service name
private static final String SERVICE = "TrustManagerFactory";
@@ -49,39 +39,17 @@
// Store default property name
private static final String PROPERTYNAME = "ssl.TrustManagerFactory.algorithm";
- // Store used provider
- private final Provider provider;
-
- // Storeused TrustManagerFactorySpi implementation
- private final TrustManagerFactorySpi spiImpl;
-
- // Store used algorithm
- private final String algorithm;
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
- protected TrustManagerFactory(TrustManagerFactorySpi factorySpi,
- Provider provider, String algorithm) {
- this.provider = provider;
- this.algorithm = algorithm;
- this.spiImpl = factorySpi;
- }
-
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public final String getAlgorithm() {
- return algorithm;
+ public static final String getDefaultAlgorithm() {
+ return AccessController.doPrivileged(new PrivilegedAction<String>() {
+ public String run() {
+ return Security.getProperty(PROPERTYNAME);
+ }
+ });
}
/**
- * @com.intel.drl.spec_ref
- *
- * throws NullPointerException if algorithm is null (instead of
- * NoSuchAlgorithmException as in 1.4 release)
+ * @throws NullPointerException if algorithm is null (instead of NoSuchAlgorithmException as in
+ * 1.4 release)
*/
public static final TrustManagerFactory getInstance(String algorithm)
throws NoSuchAlgorithmException {
@@ -90,20 +58,17 @@
}
synchronized (engine) {
engine.getInstance(algorithm, null);
- return new TrustManagerFactory((TrustManagerFactorySpi) engine.spi,
- engine.provider, algorithm);
+ return new TrustManagerFactory((TrustManagerFactorySpi) engine.spi, engine.provider,
+ algorithm);
}
}
/**
- * @com.intel.drl.spec_ref
- *
- * throws NullPointerException if algorithm is null (instead of
- * NoSuchAlgorithmException as in 1.4 release)
+ * @throws NullPointerException if algorithm is null (instead of NoSuchAlgorithmException as in
+ * 1.4 release)
*/
- public static final TrustManagerFactory getInstance(String algorithm,
- String provider) throws NoSuchAlgorithmException,
- NoSuchProviderException {
+ public static final TrustManagerFactory getInstance(String algorithm, String provider)
+ throws NoSuchAlgorithmException, NoSuchProviderException {
if ((provider == null) || (provider.length() == 0)) {
throw new IllegalArgumentException("Provider is null oe empty");
}
@@ -115,13 +80,11 @@
}
/**
- * @com.intel.drl.spec_ref
- *
- * throws NullPointerException if algorithm is null (instead of
- * NoSuchAlgorithmException as in 1.4 release)
+ * @throws NullPointerException if algorithm is null (instead of NoSuchAlgorithmException as in
+ * 1.4 release)
*/
- public static final TrustManagerFactory getInstance(String algorithm,
- Provider provider) throws NoSuchAlgorithmException {
+ public static final TrustManagerFactory getInstance(String algorithm, Provider provider)
+ throws NoSuchAlgorithmException {
if (provider == null) {
throw new IllegalArgumentException("Provider is null");
}
@@ -130,54 +93,44 @@
}
synchronized (engine) {
engine.getInstance(algorithm, provider, null);
- return new TrustManagerFactory((TrustManagerFactorySpi) engine.spi,
- provider, algorithm);
+ return new TrustManagerFactory((TrustManagerFactorySpi) engine.spi, provider, algorithm);
}
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
+ // Store used provider
+ private final Provider provider;
+
+ // Store used TrustManagerFactorySpi implementation
+ private final TrustManagerFactorySpi spiImpl;
+
+ // Store used algorithm
+ private final String algorithm;
+
+ protected TrustManagerFactory(TrustManagerFactorySpi factorySpi, Provider provider,
+ String algorithm) {
+ this.provider = provider;
+ this.algorithm = algorithm;
+ this.spiImpl = factorySpi;
+ }
+
+ public final String getAlgorithm() {
+ return algorithm;
+ }
+
public final Provider getProvider() {
return provider;
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public final void init(KeyStore ks) throws KeyStoreException {
spiImpl.engineInit(ks);
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public final void init(ManagerFactoryParameters spec)
- throws InvalidAlgorithmParameterException {
+ public final void init(ManagerFactoryParameters spec) throws InvalidAlgorithmParameterException {
spiImpl.engineInit(spec);
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
public final TrustManager[] getTrustManagers() {
return spiImpl.engineGetTrustManagers();
}
- /**
- * @com.intel.drl.spec_ref
- *
- */
- public static final String getDefaultAlgorithm() {
- return AccessController
- .doPrivileged(new java.security.PrivilegedAction<String>() {
- public String run() {
- return Security.getProperty(PROPERTYNAME);
- }
- });
- }
-}
\ No newline at end of file
+}