Bug 121997 - Cryptographic components in Platform blocks shipping for RCP Application
diff --git a/bundles/org.eclipse.core.runtime.compatibility.auth/.classpath b/bundles/org.eclipse.core.runtime.compatibility.auth/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.core.runtime.compatibility.auth/.cvsignore b/bundles/org.eclipse.core.runtime.compatibility.auth/.cvsignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/bundles/org.eclipse.core.runtime.compatibility.auth/.project b/bundles/org.eclipse.core.runtime.compatibility.auth/.project
new file mode 100644
index 0000000..545efb0
--- /dev/null
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.core.runtime.compatibility.auth</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.core.runtime.compatibility.auth/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.core.runtime.compatibility.auth/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 0000000..6b9194f
--- /dev/null
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+#Sat Mar 11 22:15:20 EST 2006
+eclipse.preferences.version=1
+pluginProject.extensions=false
diff --git a/bundles/org.eclipse.core.runtime.compatibility.auth/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.runtime.compatibility.auth/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..5dabf21
--- /dev/null
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.core.runtime.compatibility.auth
+Bundle-Version: 3.2.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Import-Package: org.eclipse.osgi.framework.log,
+ org.eclipse.osgi.service.datalocation,
+ org.eclipse.osgi.util;version="1.0.0",
+ org.osgi.framework,
+ org.osgi.util.tracker
+Require-Bundle: org.eclipse.equinox.common
+Bundle-Activator: org.eclipse.core.internal.runtime.auth.Activator
+Export-Package: org.eclipse.core.internal.runtime.auth;x-friends:="org.eclipse.core.runtime"
+Eclipse-LazyStart: true
diff --git a/bundles/org.eclipse.core.runtime.compatibility.auth/about.html b/bundles/org.eclipse.core.runtime.compatibility.auth/about.html
new file mode 100644
index 0000000..20d1e42
--- /dev/null
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/about.html
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>April 11, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html" target="_blank">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
+
+<h3>Cryptography</h3>
+
+<p><b>Export Control</b></p>
+<p>The plug-in contains encryption software.  The country in which you are currently may have restrictions on the import, possession,
+and use, and/or re-export to another country, of encryption software.  BEFORE using any encryption software, please check the country's
+laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this
+is permitted.</p>
+
+<p><b>Encryption Items</b></p>
+
+<p>Details of the encryption software in this plug-in are provided to assist in obtaining relevant export control classification and approval.
+Cryptography in this plug-in has been classified as Export Commodity Control Number (ECCN) 5D002.c.1 by the U.S. Government Department of Commerce,
+Bureau of Export Administration and deemed eligible for export under License Exception Technology Software Unrestricted (TSU) for both object code
+and source code.</p>
+
+<p>The plug-in contains a proprietary routine that encrypts and decrypts information used to login to Version Control Management (VCM) repositories.
+This routine uses the SHA-1 message digest algorithm implemented in a Java (TM) Runtime Environment (JRE), to generate a cryptographically secure sequence of bytes based on a
+user-supplied password combined with bytes supplied by a random number generator.  The secure random numbers generated by this sequence are then added to each byte in the data
+to be encrypted. When the data is to be decrypted, the same password will generate the same sequence of random numbers, which is then subtracted from each byte in the encrypted data.
+Note that a JRE and therefore the aforementioned SHA-1 message digest code is not included with the plug-in.</p>
+
+<p>The following Java classes contain encryption items (the plug-in may contain both binary and source code):</p>
+
+<ul>
+	<li>org.eclipse.core.internal.runtime.auth.Cipher</li>
+</ul>
+
+<small>Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.</small>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.core.runtime.compatibility.auth/build.properties b/bundles/org.eclipse.core.runtime.compatibility.auth/build.properties
new file mode 100644
index 0000000..cdd2db7
--- /dev/null
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               about.html,\
+               plugin.properties
+src.includes = about.html
diff --git a/bundles/org.eclipse.core.runtime.compatibility.auth/plugin.properties b/bundles/org.eclipse.core.runtime.compatibility.auth/plugin.properties
new file mode 100644
index 0000000..20f5a09
--- /dev/null
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/plugin.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2006 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+pluginName = Authorization Compatibility Plug-in
+providerName = Eclipse.org
diff --git a/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/Activator.java b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/Activator.java
new file mode 100644
index 0000000..bf8a2dc
--- /dev/null
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/Activator.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.core.internal.runtime.auth;
+
+import java.util.ArrayList;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.osgi.framework.log.FrameworkLog;
+import org.eclipse.osgi.framework.log.FrameworkLogEntry;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.util.tracker.ServiceTracker;
+
+public class Activator implements BundleActivator {
+
+	private static BundleContext bundleContext;
+	private static ServiceTracker logTracker;
+
+	/*
+	 * Return this activator's bundle context.
+	 */
+	public static BundleContext getContext() {
+		return bundleContext;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		Activator.bundleContext = context;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		if (logTracker != null) {
+			logTracker.close();
+			logTracker = null;
+		}
+		Activator.bundleContext = null;
+	}
+
+	/*
+	 * Log the given status in the framework log.
+	 */
+	public static void log(IStatus status) {
+		if (logTracker == null) {
+			logTracker = new ServiceTracker(getContext(), FrameworkLog.class.getName(), null);
+			logTracker.open();
+		}
+		FrameworkLog log = (FrameworkLog) logTracker.getService();
+		log.log(getEntry(status));
+	}
+
+	/*
+	 * Copied code from PlatformLogWriter to convert a status object into
+	 * a FrameworkLogEntry.
+	 */
+	private static FrameworkLogEntry getEntry(IStatus status) {
+		Throwable t = status.getException();
+		ArrayList childlist = new ArrayList();
+
+		int stackCode = t instanceof CoreException ? 1 : 0;
+		// ensure a sub-status inside a CoreException is properly logged 
+		if (stackCode == 1) {
+			IStatus coreStatus = ((CoreException) t).getStatus();
+			if (coreStatus != null)
+				childlist.add(getEntry(coreStatus));
+		}
+
+		if (status.isMultiStatus()) {
+			IStatus[] children = status.getChildren();
+			for (int i = 0; i < children.length; i++)
+				childlist.add(getEntry(children[i]));
+		}
+
+		FrameworkLogEntry[] children = (FrameworkLogEntry[]) (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()]));
+
+		return new FrameworkLogEntry(status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), stackCode, t, children);
+	}
+
+}
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationDatabase.java b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/AuthorizationDatabase.java
similarity index 88%
rename from bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationDatabase.java
rename to bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/AuthorizationDatabase.java
index 4884bec..8e201b4 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationDatabase.java
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/AuthorizationDatabase.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
-package org.eclipse.core.internal.runtime;
+package org.eclipse.core.internal.runtime.auth;
 
 import java.io.*;
 import java.net.URL;
@@ -17,7 +17,7 @@
 import org.eclipse.osgi.util.NLS;
 
 /**
- * A database that remembers information, such as usernames and
+ * A database that remembers information, such as user-names and
  * passwords.  The information is stored in memory and can be saved
  * to disk in an encrypted format.  While the API is phrased in terms of
  * URLs, realms and authentication schemes, not all of these must have
@@ -26,10 +26,25 @@
  * <code>null</code>).
  */
 public class AuthorizationDatabase {
+	public static final String PI_RUNTIME_AUTH = "org.eclipse.core.runtime.auth.compatibility"; //$NON-NLS-1$
+
 	/**
-	 * Version number for the format of the keyring file.
+	 * Status code constant (value 4) indicating the platform could not read
+	 * some of its metadata.
+	 */
+	public static final int FAILED_READ_METADATA = 4;
+
+	/**
+	 * Status code constant (value 5) indicating the platform could not write
+	 * some of its metadata.
+	 */
+	public static final int FAILED_WRITE_METADATA = 5;
+
+	/**
+	 * Version number for the format of the key-ring file.
 	 */
 	private static final int KEYRING_FILE_VERSION = 1;
+
 	/**
 	 * A nested hashtable that stores authorization information. The
 	 * table maps server URLs to realms to authentication schemes to
@@ -262,9 +277,9 @@
 				input.close();
 			}
 		} catch (IOException e) {
-			throw new CoreException(new Status(IStatus.ERROR, Platform.PI_RUNTIME, Platform.FAILED_READ_METADATA, NLS.bind(Messages.meta_unableToReadAuthorization, file), e));
+			throw new CoreException(new Status(IStatus.ERROR, PI_RUNTIME_AUTH, FAILED_READ_METADATA, NLS.bind(Messages.meta_unableToReadAuthorization, file), e));
 		} catch (ClassNotFoundException e) {
-			throw new CoreException(new Status(IStatus.ERROR, Platform.PI_RUNTIME, Platform.FAILED_READ_METADATA, NLS.bind(Messages.meta_unableToReadAuthorization, file), e));
+			throw new CoreException(new Status(IStatus.ERROR, PI_RUNTIME_AUTH, FAILED_READ_METADATA, NLS.bind(Messages.meta_unableToReadAuthorization, file), e));
 		}
 	}
 
@@ -283,7 +298,7 @@
 			}
 		} else {
 			//the format has changed, just log a warning
-			InternalPlatform.getDefault().log(new Status(IStatus.WARNING, Platform.PI_RUNTIME, Platform.FAILED_READ_METADATA, Messages.meta_authFormatChanged, null));
+			Activator.log(new Status(IStatus.WARNING, PI_RUNTIME_AUTH, FAILED_READ_METADATA, Messages.meta_authFormatChanged, null));
 			//close the stream and save a new file in the correct format
 			try {
 				is.close();
@@ -304,7 +319,7 @@
 		try {
 			file.delete();
 			if ((!file.getParentFile().exists() && !file.getParentFile().mkdirs()) || !canWrite(file.getParentFile()))
-				throw new CoreException(new Status(IStatus.ERROR, Platform.PI_RUNTIME, Platform.FAILED_WRITE_METADATA, NLS.bind(Messages.meta_unableToWriteAuthorization, file), null));
+				throw new CoreException(new Status(IStatus.ERROR, PI_RUNTIME_AUTH, FAILED_WRITE_METADATA, NLS.bind(Messages.meta_unableToWriteAuthorization, file), null));
 			file.createNewFile();
 			FileOutputStream out = new FileOutputStream(file);
 			try {
@@ -313,7 +328,7 @@
 				out.close();
 			}
 		} catch (IOException e) {
-			throw new CoreException(new Status(IStatus.ERROR, Platform.PI_RUNTIME, Platform.FAILED_WRITE_METADATA, NLS.bind(Messages.meta_unableToWriteAuthorization, file), e));
+			throw new CoreException(new Status(IStatus.ERROR, PI_RUNTIME_AUTH, FAILED_WRITE_METADATA, NLS.bind(Messages.meta_unableToWriteAuthorization, file), e));
 		}
 		needsSaving = false;
 	}
@@ -329,7 +344,7 @@
 		try {
 			fileTest = File.createTempFile("writtableArea", null, installDir); //$NON-NLS-1$
 		} catch (IOException e) {
-			//If an exception occured while trying to create the file, it means that it is not writtable
+			// If an exception occurred while trying to create the file, it means that it is not writable
 			return false;
 		} finally {
 			if (fileTest != null)
diff --git a/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/AuthorizationHandler.java b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/AuthorizationHandler.java
new file mode 100644
index 0000000..557ddb8
--- /dev/null
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/AuthorizationHandler.java
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.core.internal.runtime.auth;
+
+import java.io.File;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.osgi.service.datalocation.Location;
+import org.eclipse.osgi.util.NLS;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+
+// This class factors out the management of the .keyring location
+public class AuthorizationHandler {
+	/* package */static final String F_KEYRING = ".keyring"; //$NON-NLS-1$
+
+	//Authorization related informations
+	private static AuthorizationDatabase keyring = null;
+	private static long keyringTimeStamp;
+	private static String keyringFile = null;
+	private static String password = ""; //$NON-NLS-1$
+
+	/**
+	 * Opens the password database (if any) initially provided to the platform at startup.
+	 */
+	private static void loadKeyring() throws CoreException {
+		if (keyring != null && new File(keyringFile).lastModified() == keyringTimeStamp)
+			return;
+		if (keyringFile == null) {
+			ServiceReference[] refs = null;
+			try {
+				refs = Activator.getContext().getServiceReferences(Location.class.getName(), Location.CONFIGURATION_FILTER);
+				if (refs == null || refs.length == 0)
+					return;
+			} catch (InvalidSyntaxException e) {
+				// ignore this.  It should never happen as we have tested the above format.
+			}
+			Location configurationLocation = (Location) Activator.getContext().getService(refs[0]);
+			if (configurationLocation == null)
+				return;
+			File file = new File(configurationLocation.getURL().getPath() + "/org.eclipse.core.runtime");
+			Activator.getContext().ungetService(refs[0]);
+			file = new File(file, F_KEYRING);
+			keyringFile = file.getAbsolutePath();
+		}
+		try {
+			keyring = new AuthorizationDatabase(keyringFile, password);
+		} catch (CoreException e) {
+			Activator.log(e.getStatus());
+		}
+		if (keyring == null) {
+			//try deleting the file and loading again - format may have changed
+			new java.io.File(keyringFile).delete();
+			keyring = new AuthorizationDatabase(keyringFile, password);
+			//don't bother logging a second failure and let it flows to the callers
+		}
+		keyringTimeStamp = new File(keyringFile).lastModified();
+	}
+
+	/**
+	 * Adds the given authorization information to the key ring. The
+	 * information is relevant for the specified protection space and the
+	 * given authorization scheme. The protection space is defined by the
+	 * combination of the given server URL and realm. The authorization 
+	 * scheme determines what the authorization information contains and how 
+	 * it should be used. The authorization information is a <code>Map</code> 
+	 * of <code>String</code> to <code>String</code> and typically
+	 * contains information such as user names and passwords.
+	 *
+	 * @param serverUrl the URL identifying the server for this authorization
+	 *		information. For example, "http://www.example.com/".
+	 * @param realm the subsection of the given server to which this
+	 *		authorization information applies.  For example,
+	 *		"realm1@example.com" or "" for no realm.
+	 * @param authScheme the scheme for which this authorization information
+	 *		applies. For example, "Basic" or "" for no authorization scheme
+	 * @param info a <code>Map</code> containing authorization information 
+	 *		such as user names and passwords (key type : <code>String</code>, 
+	 *		value type : <code>String</code>)
+	 * @exception CoreException if there are problems setting the
+	 *		authorization information. Reasons include:
+	 * <ul>
+	 * <li>The keyring could not be saved.</li>
+	 * </ul>
+	 * XXX Move to a plug-in to be defined (JAAS plugin).
+	 */
+	public static void addAuthorizationInfo(URL serverUrl, String realm, String authScheme, Map info) throws CoreException {
+		loadKeyring();
+		keyring.addAuthorizationInfo(serverUrl, realm, authScheme, new HashMap(info));
+		keyring.save();
+	}
+
+	/**
+	 * Adds the specified resource to the protection space specified by the
+	 * given realm. All targets at or deeper than the depth of the last
+	 * symbolic element in the path of the given resource URL are assumed to
+	 * be in the same protection space.
+	 *
+	 * @param resourceUrl the URL identifying the resources to be added to
+	 *		the specified protection space. For example,
+	 *		"http://www.example.com/folder/".
+	 * @param realm the name of the protection space. For example,
+	 *		"realm1@example.com"
+	 * @exception CoreException if there are problems setting the
+	 *		authorization information. Reasons include:
+	 * <ul>
+	 * <li>The key ring could not be saved.</li>
+	 * </ul>
+	 * XXX Move to a plug-in to be defined (JAAS plugin).
+	 */
+	public static void addProtectionSpace(URL resourceUrl, String realm) throws CoreException {
+		loadKeyring();
+		keyring.addProtectionSpace(resourceUrl, realm);
+		keyring.save();
+	}
+
+	/**
+	 * Removes the authorization information for the specified protection
+	 * space and given authorization scheme. The protection space is defined
+	 * by the given server URL and realm.
+	 *
+	 * @param serverUrl the URL identifying the server to remove the
+	 *		authorization information for. For example,
+	 *		"http://www.example.com/".
+	 * @param realm the subsection of the given server to remove the
+	 *		authorization information for. For example,
+	 *		"realm1@example.com" or "" for no realm.
+	 * @param authScheme the scheme for which the authorization information
+	 *		to remove applies. For example, "Basic" or "" for no
+	 *		authorization scheme.
+	 * @exception CoreException if there are problems removing the
+	 *		authorization information. Reasons include:
+	 * <ul>
+	 * <li>The keyring could not be saved.</li>
+	 * </ul>
+	 * XXX Move to a plug-in to be defined (JAAS plugin).
+	 */
+	public static void flushAuthorizationInfo(URL serverUrl, String realm, String authScheme) throws CoreException {
+		loadKeyring();
+		keyring.flushAuthorizationInfo(serverUrl, realm, authScheme);
+		keyring.save();
+	}
+
+	/**
+	 * Returns the authorization information for the specified protection
+	 * space and given authorization scheme. The protection space is defined
+	 * by the given server URL and realm. Returns <code>null</code> if no
+	 * such information exists.
+	 *
+	 * @param serverUrl the URL identifying the server for the authorization
+	 *		information. For example, "http://www.example.com/".
+	 * @param realm the subsection of the given server to which the
+	 *		authorization information applies.  For example,
+	 *		"realm1@example.com" or "" for no realm.
+	 * @param authScheme the scheme for which the authorization information
+	 *		applies. For example, "Basic" or "" for no authorization scheme
+	 * @return the authorization information for the specified protection
+	 *		space and given authorization scheme, or <code>null</code> if no
+	 *		such information exists
+	 *XXX Move to a plug-in to be defined (JAAS plugin).
+	 */
+	public static Map getAuthorizationInfo(URL serverUrl, String realm, String authScheme) {
+		Map info = null;
+		try {
+			loadKeyring();
+			info = keyring.getAuthorizationInfo(serverUrl, realm, authScheme);
+		} catch (CoreException e) {
+			// The error has already been logged in loadKeyring()
+		}
+		return info == null ? null : new HashMap(info);
+	}
+
+	/**
+	 * Returns the protection space (realm) for the specified resource, or
+	 * <code>null</code> if the realm is unknown.
+	 *
+	 * @param resourceUrl the URL of the resource whose protection space is
+	 *		returned. For example, "http://www.example.com/folder/".
+	 * @return the protection space (realm) for the specified resource, or
+	 *		<code>null</code> if the realm is unknown
+	 *	 * XXX Move to a plug-in to be defined (JAAS plugin).
+	 */
+	public static String getProtectionSpace(URL resourceUrl) {
+		try {
+			loadKeyring();
+		} catch (CoreException e) {
+			// The error has already been logged in loadKeyring()
+			return null;
+		}
+		return keyring.getProtectionSpace(resourceUrl);
+	}
+
+	public static void setKeyringFile(String file) {
+		if (keyringFile != null)
+			throw new IllegalStateException(NLS.bind(Messages.meta_keyringFileAlreadySpecified, keyringFile));
+		keyringFile = file;
+	}
+
+	public static void setPassword(String keyringPassword) {
+		password = keyringPassword;
+	}
+}
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/Cipher.java b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/Cipher.java
similarity index 97%
rename from bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/Cipher.java
rename to bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/Cipher.java
index 5df2c63..7fa97d7 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/Cipher.java
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/Cipher.java
@@ -1,14 +1,14 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
-package org.eclipse.core.internal.runtime;
+package org.eclipse.core.internal.runtime.auth;
 
 import java.io.UnsupportedEncodingException;
 import java.security.MessageDigest;
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/CipherInputStream.java b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/CipherInputStream.java
similarity index 95%
rename from bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/CipherInputStream.java
rename to bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/CipherInputStream.java
index f6f83b4..ec8d276 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/CipherInputStream.java
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/CipherInputStream.java
@@ -1,14 +1,14 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
-package org.eclipse.core.internal.runtime;
+package org.eclipse.core.internal.runtime.auth;
 
 import java.io.*;
 
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/CipherOutputStream.java b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/CipherOutputStream.java
similarity index 92%
rename from bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/CipherOutputStream.java
rename to bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/CipherOutputStream.java
index 5b2cdb3..7301435 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/CipherOutputStream.java
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/CipherOutputStream.java
@@ -1,14 +1,14 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
-package org.eclipse.core.internal.runtime;
+package org.eclipse.core.internal.runtime.auth;
 
 import java.io.*;
 
diff --git a/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/Messages.java b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/Messages.java
new file mode 100644
index 0000000..6e001e2
--- /dev/null
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/Messages.java
@@ -0,0 +1,108 @@
+/**********************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others. All rights reserved.   This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors: 
+ * IBM - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.core.internal.runtime.auth;
+
+import org.eclipse.osgi.util.NLS;
+
+// Runtime plugin message catalog
+public class Messages extends NLS {
+	private static final String BUNDLE_NAME = "org.eclipse.core.internal.runtime.messages"; //$NON-NLS-1$
+
+	// Adapter manager
+	public static String adapters_badAdapterFactory;
+
+	// application
+	public static String application_invalidExtension;
+	public static String application_noIdFound;
+	public static String application_notFound;
+	public static String application_returned;
+
+	// line separator platforms
+	public static String line_separator_platform_mac_os_9;
+	public static String line_separator_platform_unix;
+	public static String line_separator_platform_windows;
+
+	// metadata
+	public static String meta_appNotInit;
+	public static String meta_authFormatChanged;
+	public static String meta_exceptionParsingLog;
+	public static String meta_keyringFileAlreadySpecified;
+
+	// Extension Registry
+	public static String meta_unableToReadAuthorization;
+	public static String meta_unableToWriteAuthorization;
+
+	// parsing/resolve
+	public static String plugin_deactivatedLoad;
+
+	// plugins
+	public static String plugin_shutdownProblems;
+	public static String plugin_startupProblems;
+
+	// Preferences
+	public static String preferences_saveProblems;
+
+	// Product
+	public static String product_notFound;
+	public static String provider_invalid;
+	public static String provider_invalid_general;
+
+	// Compatibility - parsing/resolve
+	public static String parse_badPrereqOnFrag;
+	public static String parse_duplicateFragment;
+	public static String parse_duplicateLib;
+	public static String parse_internalStack;
+	public static String parse_unknownElement;
+	public static String parse_unknownTopElement;
+	public static String parse_unknownAttribute;
+	public static String parse_error;
+	public static String parse_errorProcessing;
+	public static String parse_errorNameLineColumn;
+	public static String parse_validExport;
+	public static String parse_validMatch;
+	public static String parse_unknownLibraryType;
+	public static String parse_nullFragmentIdentifier;
+	public static String parse_nullPluginIdentifier;
+	public static String parse_duplicatePlugin;
+	public static String parse_unknownEntry;
+	public static String parse_missingPluginId;
+	public static String parse_missingPluginName;
+	public static String parse_missingFPName;
+	public static String parse_missingFPVersion;
+	public static String parse_missingPluginVersion;
+	public static String parse_fragmentMissingAttr;
+	public static String parse_pluginMissingAttr;
+	public static String parse_pluginMissingIdName;
+	public static String parse_fragmentMissingIdName;
+	public static String parse_missingFragmentPd;
+	public static String parse_extPointDisabled;
+	public static String parse_extPointUnknown;
+	public static String parse_unsatisfiedOptPrereq;
+	public static String parse_unsatisfiedPrereq;
+	public static String parse_prereqDisabled;
+	public static String parse_prereqLoop;
+	public static String parse_prereqOptLoop;
+
+	// Compatibility - plugins
+	public static String plugin_notPluginClass;
+	public static String plugin_unableToResolve;
+	public static String plugin_pluginDisabled;
+	public static String plugin_instantiateClassError;
+	public static String plugin_loadClassError;
+
+	static {
+		// load message values from bundle file
+		reloadMessages();
+	}
+
+	public static void reloadMessages() {
+		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/URLTool.java b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/URLTool.java
new file mode 100644
index 0000000..742a4dd
--- /dev/null
+++ b/bundles/org.eclipse.core.runtime.compatibility.auth/src/org/eclipse/core/internal/runtime/auth/URLTool.java
@@ -0,0 +1,332 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.core.internal.runtime.auth;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Vector;
+import org.eclipse.core.runtime.Assert;
+
+/**
+ * A utility for manipulating <code>URL</code>s.
+ */
+public class URLTool {
+
+	/**
+	 * Returns the given <code>URL</code> with a trailing slash appended to
+	 * it. If the <code>URL</code> already has a trailing slash the
+	 * <code>URL</code> is returned unchanged.
+	 * <table>
+	 * <caption>Example</caption>
+	 * <tr>
+	 *   <th>Given URL</th>
+	 *   <th>Returned URL</th>
+	 * <tr>
+	 *   <td>"http://hostname/folder"</td>
+	 *   <td>"http://hostname/folder/"</td>
+	 * <tr>
+	 *   <td>"http://hostname/folder/</td>
+	 *   <td>"http://hostname/folder/"</td>
+	 * </table>
+	 *
+	 * @param url a URL
+	 * @return    the given URL with a trailing slash
+	 */
+	public static URL appendTrailingSlash(URL url) {
+		String file = url.getFile();
+		if (file.endsWith("/")) //$NON-NLS-1$
+			return url;
+		try {
+			return new URL(url.getProtocol(), url.getHost(), url.getPort(), file + "/"); //$NON-NLS-1$
+		} catch (MalformedURLException e) {
+			Assert.isTrue(false, "internal error"); //$NON-NLS-1$
+		}
+		return null;
+	}
+
+	/**
+	 * Returns the child URL formed by joining the given member with the
+	 * given parent URL.
+	 *
+	 * @return a child URL of the given parent
+	 */
+	public static URL getChild(URL parent, String member) {
+		String file = parent.getFile();
+		if (!file.endsWith("/")) //$NON-NLS-1$
+			file = file + "/"; //$NON-NLS-1$
+		try {
+			return new URL(parent.getProtocol(), parent.getHost(), parent.getPort(), file + member);
+		} catch (MalformedURLException e) {
+			Assert.isTrue(false, "internal error"); //$NON-NLS-1$
+		}
+		return null;
+	}
+
+	/**
+	 * Returns all elements in the given URLs path.
+	 * <table>
+	 * <caption>Example</caption>
+	 * <tr>
+	 *   <th>Given URL</th>
+	 *   <th>Element</th>
+	 * <tr>
+	 *   <td>"http://hostname/"</td>
+	 *   <td>[]</td>
+	 * <tr>
+	 *   <td>"http://hostname/folder/</td>
+	 *   <td>[folder]</td>
+	 * <tr>
+	 *   <td>"http://hostname/folder/file</td>
+	 *   <td>[folder, file]</td>
+	 * </table>
+	 * @param url a URL
+	 * @return    all elements in the given URLs path
+	 */
+	public static Vector getElements(URL url) {
+		Vector result = new Vector(5);
+		String lastElement = null;
+		while ((lastElement = getLastElement(url)) != null) {
+			result.insertElementAt(lastElement, 0);
+			url = getParent(url);
+		}
+		return result;
+	}
+
+	/**
+	 * Returns the last element in the given URLs path, or <code>null</code>
+	 * if the URL is the root.
+	 * <table>
+	 * <caption>Example</caption>
+	 * <tr>
+	 *   <th>Given URL</th>
+	 *   <th>Last Element</th>
+	 * <tr>
+	 *   <td>"http://hostname/"</td>
+	 *   <td>null</td>
+	 * <tr>
+	 *   <td>"http://hostname/folder/</td>
+	 *   <td>folder</td>
+	 * <tr>
+	 *   <td>"http://hostname/folder/file</td>
+	 *   <td>file</td>
+	 * </table>
+	 * @param url a URL
+	 * @return    the last element in the given URLs path, or
+	 *            <code>null</code> if the URL is the root
+	 */
+	public static String getLastElement(URL url) {
+		String file = url.getFile();
+		int len = file.length();
+		if (len == 0 || len == 1 && file.charAt(0) == '/')
+			return null;
+
+		int lastSlashIndex = -1;
+		for (int i = len - 2; lastSlashIndex == -1 && i >= 0; --i) {
+			if (file.charAt(i) == '/')
+				lastSlashIndex = i;
+		}
+		boolean isDirectory = file.charAt(len - 1) == '/';
+		if (lastSlashIndex == -1) {
+			if (isDirectory) {
+				return file.substring(0, len - 1);
+			} else {
+				return file;
+			}
+		} else {
+			if (isDirectory) {
+				return file.substring(lastSlashIndex + 1, len - 1);
+			} else {
+				return file.substring(lastSlashIndex + 1, len);
+			}
+		}
+	}
+
+	/**
+	 * Returns the parent URL of the given URL, or <code>null</code> if the
+	 * given URL is the root.
+	 * <table>
+	 * <caption>Example</caption>
+	 * <tr>
+	 *   <th>Given URL</th>
+	 *   <th>Parent URL</th>
+	 * <tr>
+	 *   <td>"http://hostname/"</td>
+	 *   <td>null</td>
+	 * <tr>
+	 *   <td>"http://hostname/folder/file</td>
+	 *   <td>"http://hostname/folder/</td>
+	 * </table>
+	 *
+	 * @param url a URL
+	 * @return    the parent of the given URL
+	 */
+	public static URL getParent(URL url) {
+		String file = url.getFile();
+		int len = file.length();
+		if (len == 0 || len == 1 && file.charAt(0) == '/')
+			return null;
+		int lastSlashIndex = -1;
+		for (int i = len - 2; lastSlashIndex == -1 && i >= 0; --i) {
+			if (file.charAt(i) == '/')
+				lastSlashIndex = i;
+		}
+		if (lastSlashIndex == -1)
+			file = ""; //$NON-NLS-1$
+		else
+			file = file.substring(0, lastSlashIndex + 1);
+
+		try {
+			url = new URL(url.getProtocol(), url.getHost(), url.getPort(), file);
+		} catch (MalformedURLException e) {
+			Assert.isTrue(false, e.getMessage());
+		}
+		return url;
+	}
+
+	/**
+	 * Returns the root URL of the given URL.
+	 * <table>
+	 * <caption>Example</caption>
+	 * <tr>
+	 *   <th>Given URL</th>
+	 *   <th>Root URL</th>
+	 * <tr>
+	 *   <td>"http://hostname/"</td>
+	 *   <td>"http://hostname/"</td>
+	 * <tr>
+	 *   <td>"http://hostname/folder/file</td>
+	 *   <td>"http://hostname/"</td>
+	 * </table>
+	 *
+	 * @param urlString a URL
+	 * @return          the root url of the given URL
+	 * @throws          MalformedURLException if the given URL is malformed
+	 */
+	public static URL getRoot(String urlString) throws MalformedURLException {
+		return getRoot(new URL(urlString));
+	}
+
+	/**
+	 * Returns the root URL of the given URL.
+	 * <table>
+	 * <caption>Example</caption>
+	 * <tr>
+	 *   <th>Given URL</th>
+	 *   <th>Root URL</th>
+	 * <tr>
+	 *   <td>"http://hostname/"</td>
+	 *   <td>"http://hostname/"</td>
+	 * <tr>
+	 *   <td>"http://hostname/folder/file</td>
+	 *   <td>"http://hostname/"</td>
+	 * </table>
+	 *
+	 * @param url a URL
+	 * @return    the root URL of the given URL
+	 */
+	public static URL getRoot(URL url) {
+		try {
+			return new URL(url.getProtocol(), url.getHost(), url.getPort(), "/"); //$NON-NLS-1$
+		} catch (MalformedURLException e) {
+			Assert.isTrue(false, "internal error"); //$NON-NLS-1$
+		}
+
+		return null;
+	}
+
+	/**
+	 * Returns the given URL with its trailing slash removed. If the URL has
+	 * no trailing slash, the URL is returned unchanged.
+	 * <table>
+	 * <caption>Example</caption>
+	 * <tr>
+	 *   <th>Given URL</th>
+	 *   <th>Returned URL</th>
+	 * <tr>
+	 *   <td>"http://hostname/folder"</td>
+	 *   <td>"http://hostname/folder"</td>
+	 * <tr>
+	 *   <td>"http://hostname/folder/</td>
+	 *   <td>"http://hostname/folder"</td>
+	 * </table>
+	 *
+	 * @param url a URL
+	 * @return    the given URL with its last slash removed
+	 */
+	public static URL removeTrailingSlash(URL url) {
+		String file = url.getFile();
+
+		if (file.endsWith("/")) { //$NON-NLS-1$
+			file = file.substring(0, file.length() - 1);
+			try {
+				return new URL(url.getProtocol(), url.getHost(), url.getPort(), file);
+			} catch (MalformedURLException e) {
+				Assert.isTrue(false, e.getMessage());
+			}
+		} else {
+			return url;
+		}
+
+		return null;
+	}
+
+	/**
+	 * Returns a boolean indicating whether the given URLs overlap.
+	 * <table>
+	 * <caption>Example</caption>
+	 * <tr>
+	 *   <th>First URL</th>
+	 *   <th>Second URL</th>
+	 *   <th>Do they overlap</th>
+	 * <tr>
+	 *   <td>"http://hostname/folder/"</td>
+	 *   <td>"http://hostname/folder/"</td>
+	 *   <td>true</td>
+	 * <tr>
+	 *   <td>"http://hostname/folder/"</td>
+	 *   <td>"http://hostname/folder/file"</td>
+	 *   <td>true</td>
+	 * <tr>
+	 *   <td>"http://hostname/folder/file"</td>
+	 *   <td>"http://hostname/folder/"</td>
+	 *   <td>true</td>
+	 * <tr>
+	 *   <td>"http://hostname/folder1/"</td>
+	 *   <td>"http://hostname/folder2/"</td>
+	 *   <td>false</td>
+	 * <tr>
+	 *   <td>"http://hostname1/folder/"</td>
+	 *   <td>"http://hostname2/folder/"</td>
+	 *   <td>false</td>
+	 * </table>
+	 * @param  url1 firt URL
+	 * @param  url2 second URL
+	 * @return a boolean indicating whether the given URLs overlap
+	 */
+	public static boolean urlsOverlap(URL url1, URL url2) {
+		if (!getRoot(url1).equals(getRoot(url2))) {
+			return false;
+		}
+
+		Vector elements1 = URLTool.getElements(url1);
+		Vector elements2 = URLTool.getElements(url2);
+
+		for (int i = 0; i < elements1.size() && i < elements2.size(); ++i) {
+			String element1 = (String) elements1.elementAt(i);
+			String element2 = (String) elements2.elementAt(i);
+			if (!element1.equals(element2)) {
+				return false;
+			}
+		}
+
+		return true;
+	}
+}
diff --git a/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF
index 10cd71a..e8a33f3 100644
--- a/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF
@@ -14,5 +14,6 @@
  org.eclipse.equinox.preferences;visibility:=reexport,
  org.eclipse.core.contenttype;visibility:=reexport,
  org.eclipse.equinox.common;visibility:=reexport,
- org.eclipse.osgi;bundle-version="[3.1.0,4.0.0)";visibility:=reexport
+ org.eclipse.osgi;bundle-version="[3.1.0,4.0.0)";visibility:=reexport,
+ org.eclipse.core.runtime.compatibility.auth
 Eclipse-LazyStart: true
diff --git a/bundles/org.eclipse.core.runtime/about.html b/bundles/org.eclipse.core.runtime/about.html
index fe27420..7b81d8b 100644
--- a/bundles/org.eclipse.core.runtime/about.html
+++ b/bundles/org.eclipse.core.runtime/about.html
@@ -7,7 +7,7 @@
 <body lang="EN-US">
 <h2>About This Content</h2>
 
-<p>April 4, 2006</p>	
+<p>April 11, 2006</p>	
 <h3>License</h3>
 
 <p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
@@ -73,38 +73,9 @@
 or may not be a member of the OSGi Alliance).  The OSGi Alliance and its members are not responsible and shall not be held responsible in any manner for identifying or failing to identify any or all such third party
 intellectual property rights.</p>
 
-<small>OSGi&trade; is a trademark, registered trademark, or service mark of The OSGi Alliance in the US and other countries. Java is a trademark,
-registered trademark, or service mark of Sun Microsystems, Inc. in the US and other countries. All other trademarks, registered trademarks, or
-service marks used in the Content are the property of their respective owners and are hereby recognized.</small>
+<small>OSGi&trade; is a trademark, registered trademark, or service mark of The OSGi Alliance in the US and other countries.
+All other trademarks, registered trademarks, or service marks used in the Content are the property of their respective owners and are hereby recognized.</small>
 
-<h3>Cryptography</h3>
-
-<p><b>Export Control</b></p>
-<p>The plug-in contains encryption software.  The country in which you are currently may have restrictions on the import, possession,
-and use, and/or re-export to another country, of encryption software.  BEFORE using any encryption software, please check the country's
-laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this
-is permitted.</p>
-
-<p><b>Encryption Items</b></p>
-
-<p>Details of the encryption software in this plug-in are provided to assist in obtaining relevant export control classification and approval.
-Cryptography in this plug-in has been classified as Export Commodity Control Number (ECCN) 5D002.c.1 by the U.S. Government Department of Commerce,
-Bureau of Export Administration and deemed eligible for export under License Exception Technology Software Unrestricted (TSU) for both object code
-and source code.</p>
-
-<p>The plug-in contains a proprietary routine that encrypts and decrypts information used to login to Version Control Management (VCM) repositories.
-This routine uses the SHA-1 message digest algorithm implemented in a Java (TM) Runtime Environment (JRE), to generate a cryptographically secure sequence of bytes based on a
-user-supplied password combined with bytes supplied by a random number generator.  The secure random numbers generated by this sequence are then added to each byte in the data
-to be encrypted. When the data is to be decrypted, the same password will generate the same sequence of random numbers, which is then subtracted from each byte in the encrypted data.
-Note that a JRE and therefore the aforementioned SHA-1 message digest code is not included with the plug-in.</p>
-
-<p>The following Java classes contain encryption items (the plug-in may contain both binary and source code):</p>
-
-<ul>
-	<li>org.eclipse.core.internal.runtime.Cipher</li>
-</ul>
-
-<small>Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.</small>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationHandler.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationHandler.java
deleted file mode 100644
index d0bac9e..0000000
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/AuthorizationHandler.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.runtime;
-
-import java.io.File;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.osgi.util.NLS;
-
-// This class factors out the management of the .keyring location
-public class AuthorizationHandler {
-	/* package */static final String F_KEYRING = ".keyring"; //$NON-NLS-1$
-
-	//Authorization related informations
-	private static AuthorizationDatabase keyring = null;
-	private static long keyringTimeStamp;
-	private static String keyringFile = null;
-	private static String password = ""; //$NON-NLS-1$
-
-	/**
-	 * Opens the password database (if any) initally provided to the platform at startup.
-	 */
-	private static void loadKeyring() throws CoreException {
-		if (keyring != null && new File(keyringFile).lastModified() == keyringTimeStamp)
-			return;
-		if (keyringFile == null) {
-			File file = new File(InternalPlatform.getDefault().getConfigurationLocation().getURL().getPath() + '/' + Platform.PI_RUNTIME);
-			file = new File(file, F_KEYRING);
-			keyringFile = file.getAbsolutePath();
-		}
-		try {
-			keyring = new AuthorizationDatabase(keyringFile, password);
-		} catch (CoreException e) {
-			InternalPlatform.getDefault().log(e.getStatus());
-		}
-		if (keyring == null) {
-			//try deleting the file and loading again - format may have changed
-			new java.io.File(keyringFile).delete();
-			keyring = new AuthorizationDatabase(keyringFile, password);
-			//don't bother logging a second failure and let it flows to the callers
-		}
-		keyringTimeStamp = new File(keyringFile).lastModified();
-	}
-
-	/**
-	 * @see org.eclipse.core.runtime.Platform
-	 */
-	public static void addAuthorizationInfo(URL serverUrl, String realm, String authScheme, Map info) throws CoreException {
-		loadKeyring();
-		keyring.addAuthorizationInfo(serverUrl, realm, authScheme, new HashMap(info));
-		keyring.save();
-	}
-
-	/**
-	 * @see org.eclipse.core.runtime.Platform
-	 */
-	public static void addProtectionSpace(URL resourceUrl, String realm) throws CoreException {
-		loadKeyring();
-		keyring.addProtectionSpace(resourceUrl, realm);
-		keyring.save();
-	}
-
-	/**
-	 * @see org.eclipse.core.runtime.Platform
-	 */
-	public static void flushAuthorizationInfo(URL serverUrl, String realm, String authScheme) throws CoreException {
-		loadKeyring();
-		keyring.flushAuthorizationInfo(serverUrl, realm, authScheme);
-		keyring.save();
-	}
-
-	/**
-	 * @see org.eclipse.core.runtime.Platform
-	 */
-	public static Map getAuthorizationInfo(URL serverUrl, String realm, String authScheme) {
-		Map info = null;
-		try {
-			loadKeyring();
-			info = keyring.getAuthorizationInfo(serverUrl, realm, authScheme);
-		} catch (CoreException e) {
-			// The error has already been logged in loadKeyring()
-		}
-		return info == null ? null : new HashMap(info);
-	}
-
-	/**
-	 * @see org.eclipse.core.runtime.Platform
-	 */
-	public static String getProtectionSpace(URL resourceUrl) {
-		try {
-			loadKeyring();
-		} catch (CoreException e) {
-			// The error has already been logged in loadKeyring()
-			return null;
-		}
-		return keyring.getProtectionSpace(resourceUrl);
-	}
-
-	public static void setKeyringFile(String file) {
-		if (keyringFile != null)
-			throw new IllegalStateException(NLS.bind(Messages.meta_keyringFileAlreadySpecified, keyringFile));
-		keyringFile = file;
-	}
-
-	public static void setPassword(String keyringPassword) {
-		password = keyringPassword;
-	}
-}
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
index 8632f15..8ba0e75 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
@@ -16,6 +16,7 @@
 import java.net.URL;
 import java.util.*;
 import org.eclipse.core.internal.preferences.*;
+import org.eclipse.core.internal.runtime.auth.AuthorizationHandler;
 import org.eclipse.core.runtime.*;
 import org.eclipse.core.runtime.content.IContentTypeManager;
 import org.eclipse.core.runtime.preferences.IPreferencesService;
@@ -154,10 +155,10 @@
 		super();
 	}
 
-	public void addAuthorizationInfo(URL serverUrl, String realm, String authScheme, Map info) throws CoreException {
-		AuthorizationHandler.addAuthorizationInfo(serverUrl, realm, authScheme, info);
-	}
-
+//	public void addAuthorizationInfo(URL serverUrl, String realm, String authScheme, Map info) throws CoreException {
+//		AuthorizationHandler.addAuthorizationInfo(serverUrl, realm, authScheme, info);
+//	}
+//
 	/**
 	 * @see Platform#addLogListener(ILogListener)
 	 */
@@ -166,10 +167,10 @@
 		RuntimeLog.addLogListener(listener);
 	}
 
-	public void addProtectionSpace(URL resourceUrl, String realm) throws CoreException {
-		AuthorizationHandler.addProtectionSpace(resourceUrl, realm);
-	}
-
+//	public void addProtectionSpace(URL resourceUrl, String realm) throws CoreException {
+//		AuthorizationHandler.addProtectionSpace(resourceUrl, realm);
+//	}
+//
 	private void assertInitialized() {
 		//avoid the Policy.bind if assertion is true
 		if (!initialized)
@@ -197,10 +198,10 @@
 		});
 	}
 
-	public void flushAuthorizationInfo(URL serverUrl, String realm, String authScheme) throws CoreException {
-		AuthorizationHandler.flushAuthorizationInfo(serverUrl, realm, authScheme);
-	}
-
+//	public void flushAuthorizationInfo(URL serverUrl, String realm, String authScheme) throws CoreException {
+//		AuthorizationHandler.flushAuthorizationInfo(serverUrl, realm, authScheme);
+//	}
+//
 	/**
 	 * @see Platform#getAdapterManager()
 	 */
@@ -235,10 +236,10 @@
 		return applicationId;
 	}
 
-	public Map getAuthorizationInfo(URL serverUrl, String realm, String authScheme) {
-		return AuthorizationHandler.getAuthorizationInfo(serverUrl, realm, authScheme);
-	}
-
+//	public Map getAuthorizationInfo(URL serverUrl, String realm, String authScheme) {
+//		return AuthorizationHandler.getAuthorizationInfo(serverUrl, realm, authScheme);
+//	}
+//
 	public boolean getBooleanOption(String option, boolean defaultValue) {
 		String value = getOption(option);
 		if (value == null)
@@ -647,10 +648,10 @@
 		return null;
 	}
 
-	public String getProtectionSpace(URL resourceUrl) {
-		return AuthorizationHandler.getProtectionSpace(resourceUrl);
-	}
-
+//	public String getProtectionSpace(URL resourceUrl) {
+//		return AuthorizationHandler.getProtectionSpace(resourceUrl);
+//	}
+//
 	public IExtensionRegistry getRegistry() {
 		return RegistryFactory.getRegistry(); 
 	}
@@ -727,8 +728,12 @@
 	}
 
 	private void initializeAuthorizationHandler() {
-		AuthorizationHandler.setKeyringFile(keyringFile);
-		AuthorizationHandler.setPassword(password);
+		try {
+			AuthorizationHandler.setKeyringFile(keyringFile);
+			AuthorizationHandler.setPassword(password);
+		} catch (NoClassDefFoundError e) {
+			// The authorization code is not available so do nothing
+		}
 	}
 
 	/*
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java
index 2f0cae7..e1f9b47 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java
@@ -15,6 +15,7 @@
 import java.net.URL;
 import java.util.*;
 import org.eclipse.core.internal.runtime.*;
+import org.eclipse.core.internal.runtime.auth.AuthorizationHandler;
 import org.eclipse.core.runtime.content.IContentTypeManager;
 import org.eclipse.core.runtime.jobs.IJobManager;
 import org.eclipse.core.runtime.jobs.Job;
@@ -446,10 +447,9 @@
 	 * <ul>
 	 * <li>The keyring could not be saved.</li>
 	 * </ul>
-	 * XXX Move to a plug-in to be defined (JAAS plugin).
 	 */
 	public static void addAuthorizationInfo(URL serverUrl, String realm, String authScheme, Map info) throws CoreException {
-		InternalPlatform.getDefault().addAuthorizationInfo(serverUrl, realm, authScheme, info);
+		AuthorizationHandler.addAuthorizationInfo(serverUrl, realm, authScheme, info);
 	}
 
 	/** 
@@ -485,10 +485,9 @@
 	 * <ul>
 	 * <li>The key ring could not be saved.</li>
 	 * </ul>
-	 * XXX Move to a plug-in to be defined (JAAS plugin).
 	 */
 	public static void addProtectionSpace(URL resourceUrl, String realm) throws CoreException {
-		InternalPlatform.getDefault().addProtectionSpace(resourceUrl, realm);
+		AuthorizationHandler.addProtectionSpace(resourceUrl, realm);
 	}
 
 	/**
@@ -543,10 +542,9 @@
 	 * <ul>
 	 * <li>The keyring could not be saved.</li>
 	 * </ul>
-	 * XXX Move to a plug-in to be defined (JAAS plugin).
 	 */
 	public static void flushAuthorizationInfo(URL serverUrl, String realm, String authScheme) throws CoreException {
-		InternalPlatform.getDefault().flushAuthorizationInfo(serverUrl, realm, authScheme);
+		AuthorizationHandler.flushAuthorizationInfo(serverUrl, realm, authScheme);
 	}
 
 	/**
@@ -578,10 +576,9 @@
 	 * @return the authorization information for the specified protection
 	 *		space and given authorization scheme, or <code>null</code> if no
 	 *		such information exists
-	 *XXX Move to a plug-in to be defined (JAAS plugin).
 	 */
 	public static Map getAuthorizationInfo(URL serverUrl, String realm, String authScheme) {
-		return InternalPlatform.getDefault().getAuthorizationInfo(serverUrl, realm, authScheme);
+		return AuthorizationHandler.getAuthorizationInfo(serverUrl, realm, authScheme);
 	}
 
 	/**
@@ -758,10 +755,9 @@
 	 *		returned. For example, "http://www.example.com/folder/".
 	 * @return the protection space (realm) for the specified resource, or
 	 *		<code>null</code> if the realm is unknown
-	 *	 * XXX Move to a plug-in to be defined (JAAS plugin).
 	 */
 	public static String getProtectionSpace(URL resourceUrl) {
-		return InternalPlatform.getDefault().getProtectionSpace(resourceUrl);
+		return AuthorizationHandler.getProtectionSpace(resourceUrl);
 	}
 
 	/** 
diff --git a/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/ConfigurationSessionTestSuite.java b/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/ConfigurationSessionTestSuite.java
index 09c73ea..1b17ac7 100644
--- a/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/ConfigurationSessionTestSuite.java
+++ b/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/ConfigurationSessionTestSuite.java
@@ -36,6 +36,7 @@
 		// -- end of new
 		"org.eclipse.core.runtime@2:start", 
 		"org.eclipse.core.runtime.compatibility", 
+		"org.eclipse.core.runtime.compatibility.auth", 
 		"org.eclipse.update.configurator", 
 		"org.eclipse.core.tests.harness", 
 		"org.eclipse.jdt.junit.runtime", 
diff --git a/tests/org.eclipse.core.tests.runtime/META-INF/MANIFEST.MF b/tests/org.eclipse.core.tests.runtime/META-INF/MANIFEST.MF
index a19cf2f..3f7dd55 100644
--- a/tests/org.eclipse.core.tests.runtime/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.core.tests.runtime/META-INF/MANIFEST.MF
@@ -20,6 +20,7 @@
 Require-Bundle: org.eclipse.core.runtime.compatibility,
  org.eclipse.core.tests.harness,
  org.junit,
- org.eclipse.test.performance;resolution:=optional
+ org.eclipse.test.performance;resolution:=optional,
+ org.eclipse.core.runtime.compatibility.auth
 Eclipse-AutoStart: true
 Plugin-Class: org.eclipse.core.tests.runtime.RuntimeTestsPlugin
diff --git a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/runtime/AuthorizationDatabaseTest.java b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/runtime/AuthorizationDatabaseTest.java
index 6d9411b..9414a1c 100644
--- a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/runtime/AuthorizationDatabaseTest.java
+++ b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/runtime/AuthorizationDatabaseTest.java
@@ -17,7 +17,7 @@
 import java.util.Map;
 import junit.framework.Test;
 import junit.framework.TestSuite;
-import org.eclipse.core.internal.runtime.AuthorizationDatabase;
+import org.eclipse.core.internal.runtime.auth.AuthorizationDatabase;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.tests.runtime.RuntimeTest;
 
diff --git a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/runtime/CipherStreamsTest.java b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/runtime/CipherStreamsTest.java
index 6029b31..8348245 100644
--- a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/runtime/CipherStreamsTest.java
+++ b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/runtime/CipherStreamsTest.java
@@ -13,8 +13,8 @@
 import java.io.*;
 import junit.framework.Test;
 import junit.framework.TestSuite;
-import org.eclipse.core.internal.runtime.CipherInputStream;
-import org.eclipse.core.internal.runtime.CipherOutputStream;
+import org.eclipse.core.internal.runtime.auth.CipherInputStream;
+import org.eclipse.core.internal.runtime.auth.CipherOutputStream;
 import org.eclipse.core.tests.runtime.RuntimeTest;
 
 public class CipherStreamsTest extends RuntimeTest {
diff --git a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/runtime/CipherTest.java b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/runtime/CipherTest.java
index db46ae3..5538506 100644
--- a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/runtime/CipherTest.java
+++ b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/runtime/CipherTest.java
@@ -12,7 +12,7 @@
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
-import org.eclipse.core.internal.runtime.Cipher;
+import org.eclipse.core.internal.runtime.auth.Cipher;
 import org.eclipse.core.tests.runtime.RuntimeTest;
 
 public class CipherTest extends RuntimeTest {