harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r350181 [134/198] - in /incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core: ./ depends/ depends/files/ depends/jars/ depends/libs/ depends/libs/linux.IA32/ depends/libs/win.IA32/ depends/oss/ depends/oss/linux.IA32/ depends/oss/win....
Date Thu, 01 Dec 2005 06:04:00 GMT
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/SignatureException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/SignatureException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/SignatureException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/SignatureException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,44 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security;
+
+
+/**
+ * This class represents generic security exceptions.
+ * 
+ */
+public class SignatureException extends GeneralSecurityException {
+
+	/**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 * 
+	 */
+	public SignatureException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public SignatureException(String detailMessage) {
+		super(detailMessage);
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/UnrecoverableKeyException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/UnrecoverableKeyException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/UnrecoverableKeyException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/UnrecoverableKeyException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,44 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security;
+
+
+/**
+ * This class represents exceptions if a key cannot be found in the keystore.
+ * 
+ */
+public class UnrecoverableKeyException extends GeneralSecurityException {
+
+	/**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 * 
+	 */
+	public UnrecoverableKeyException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public UnrecoverableKeyException(String detailMessage) {
+		super(detailMessage);
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/UnresolvedPermission.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/UnresolvedPermission.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/UnresolvedPermission.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/UnresolvedPermission.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,271 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateEncodingException;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.util.Hashtable;
+
+/**
+ * Holds permissions which are of an unknown type when a policy file is read
+ */
+public final class UnresolvedPermission extends Permission implements
+		Serializable {
+	static final long serialVersionUID = -4821973115467008846L;
+
+	/**
+	 * The Certificates which were used to create the receiver.
+	 */
+	private transient Certificate[] certificates;
+
+	/**
+	 * The type of permission this will be
+	 */
+	private String type;
+
+	/**
+	 * the action string
+	 */
+	private String actions;
+
+	/**
+	 * the permission name
+	 */
+	private String name;
+
+	static Class[] constructorArgs;
+	static {
+		Class string = String.class;
+		constructorArgs = new Class[] { string, string };
+	}
+
+	/**
+	 * Constructs a new instance of this class with its type, name, and
+	 * certificates set to the arguments by definition, actions are ignored
+	 * 
+	 * @param type
+	 *            class of permission object
+	 * @param name
+	 *            identifies the permission that could not be resolved
+	 * @param actions
+	 * @param certs
+	 */
+	public UnresolvedPermission(String type, String name, String actions,
+			Certificate[] certs) {
+		super(type);
+		this.name = name;
+		this.certificates = certs;
+		this.type = type;
+		this.actions = actions;
+	}
+
+	/**
+	 * Compares the argument to the receiver, and answers true if they represent
+	 * the <em>same</em> object using a class specific comparison. In this
+	 * case, the receiver and the object must have the same class, permission
+	 * name, actions, and certificates
+	 * 
+	 * @param obj
+	 *            the object to compare with this object
+	 * @return <code>true</code> if the object is the same as this object,
+	 *         <code>false</code> otherwise.
+	 * 
+	 * @see #hashCode
+	 */
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (!(obj instanceof UnresolvedPermission))
+			return false;
+		UnresolvedPermission perm = (UnresolvedPermission) obj;
+		if (!(type.equals(perm.type) && name.equals(perm.name) && actions
+				.equals(perm.actions)))
+			return false;
+		if (certificates == null && perm.certificates == null)
+			return true;
+		if (certificates.length != perm.certificates.length)
+			return false;
+		Hashtable set = new Hashtable();
+		for (int i = 0; i < certificates.length; i++)
+			set.put(certificates[i], certificates[i]);
+		for (int i = 0; i < perm.certificates.length; i++)
+			if (set.get(perm.certificates[i]) == null)
+				return false;
+		return true;
+	}
+
+	/**
+	 * Indicates whether the argument permission is implied by the receiver.
+	 * UnresolvedPermission objects imply nothing because nothing is known about
+	 * them yet.
+	 * 
+	 * @param p
+	 *            the permission to check
+	 * @return always replies false
+	 */
+	public boolean implies(Permission p) {
+		return false;
+	}
+
+	/**
+	 * Answers a new PermissionCollection for holding permissions of this class.
+	 * Answer null if any permission collection can be used.
+	 * 
+	 * @return a new PermissionCollection or null
+	 * 
+	 * @see java.security.BasicPermissionCollection
+	 */
+	public PermissionCollection newPermissionCollection() {
+		return new UnresolvedPermissionCollection();
+	}
+
+	/**
+	 * Answers the actions associated with the receiver. Since
+	 * UnresolvedPermission objects have no actions, answer the empty string.
+	 * 
+	 * @return the actions associated with the receiver.
+	 */
+	public String getActions() {
+		return "";
+	}
+
+	/**
+	 * Answers an integer hash code for the receiver. Any two objects which
+	 * answer <code>true</code> when passed to <code>equals</code> must
+	 * answer the same value for this method.
+	 * 
+	 * @return the receiver's hash
+	 * 
+	 * @see #equals
+	 */
+	public int hashCode() {
+		return toString().hashCode();
+	}
+
+	/**
+	 * Answers a string containing a concise, human-readable description of the
+	 * receiver.
+	 * 
+	 * @return a printable representation for the receiver.
+	 */
+	public String toString() {
+		return "(unresolved " + type + " " + name + " " + actions + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+	}
+
+	Permission resolve(ClassLoader cl) {
+		try {
+			// Check certificates : the permission loaded must have each
+			// certificate this has.
+			Class permClass = Class.forName(type, true, cl);
+			boolean certified = true;
+			Hashtable classCertificatesSet = null;
+			if (permClass.getSigners() != null) {
+				Certificate[] classCertificates = (Certificate[]) permClass
+						.getSigners();
+				classCertificatesSet = new Hashtable(
+						classCertificates.length * 3 / 2);
+				for (int i = 0; i < classCertificates.length; ++i)
+					if (classCertificates[i] != null)
+						classCertificatesSet.put(classCertificates[i],
+								classCertificates[i]);
+				if (classCertificatesSet.size() == 0)
+					classCertificatesSet = null;
+			}
+			if (certificates != null) {
+				if (classCertificatesSet == null) {
+					for (int i = 0; i < certificates.length; ++i)
+						if (certificates[i] != null) {
+							certified = false;
+							break;
+						}
+				} else {
+					for (int i = 0; i < certificates.length; ++i)
+						if (certificates[i] != null
+								&& !classCertificatesSet
+										.containsKey(certificates[i])) {
+							certified = false;
+							break;
+						}
+				}
+			}
+			if (certified) {
+				Constructor constructor = permClass
+						.getConstructor(constructorArgs);
+				return (Permission) constructor.newInstance(new Object[] {
+						name, actions });
+			}
+		} catch (ClassNotFoundException e) {
+		} catch (NoSuchMethodException e) {
+		} catch (InstantiationException e) {
+		} catch (InvocationTargetException e) {
+		} catch (IllegalAccessException e) {
+		}
+		return null;
+	}
+
+	private void writeObject(ObjectOutputStream stream) throws IOException {
+		stream.defaultWriteObject();
+		int length = 0;
+		if (certificates != null)
+			length = certificates.length;
+		stream.writeInt(length);
+		for (int i = 0; i < length; i++) {
+			stream.writeUTF(certificates[i].getType());
+			try {
+				byte[] encoded = certificates[i].getEncoded();
+				stream.writeInt(encoded.length);
+				stream.write(encoded);
+			} catch (CertificateEncodingException e) {
+				stream.writeInt(0);
+			}
+		}
+	}
+
+	private void readObject(ObjectInputStream stream) throws IOException,
+			ClassNotFoundException {
+		stream.defaultReadObject();
+		int count = stream.readInt();
+		if (count > 0) {
+			certificates = new Certificate[count];
+			for (int i = 0; i < count; i++) {
+				String certType = stream.readUTF();
+				int length = stream.readInt();
+				if (length > 0) {
+					byte[] encoded = new byte[length];
+					stream.read(encoded);
+					try {
+						CertificateFactory factory = CertificateFactory
+								.getInstance(certType);
+						certificates[i] = factory
+								.generateCertificate(new ByteArrayInputStream(
+										encoded));
+					} catch (CertificateException e) {
+					}
+				}
+			}
+		}
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/UnresolvedPermissionCollection.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/UnresolvedPermissionCollection.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/UnresolvedPermissionCollection.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/UnresolvedPermissionCollection.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,75 @@
+/* Copyright 2000, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security;
+
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
+
+class UnresolvedPermissionCollection extends PermissionCollection {
+	static final long serialVersionUID = -7176153071733132400L;
+
+	Hashtable permissions = new Hashtable(8);
+
+	public void add(Permission permission) {
+		if (isReadOnly())
+			throw new IllegalStateException();
+		Vector elements = (Vector) permissions.get(permission.getName());
+		if (elements == null) {
+			elements = new Vector();
+			permissions.put(permission.getName(), elements);
+		}
+		elements.addElement(permission);
+	}
+
+	public Enumeration elements() {
+		return new Enumeration() {
+			Enumeration vEnum, pEnum = permissions.elements();
+
+			Object next = findNext();
+
+			private Object findNext() {
+				if (vEnum != null) {
+					if (vEnum.hasMoreElements())
+						return vEnum.nextElement();
+				}
+				if (!pEnum.hasMoreElements())
+					return null;
+				vEnum = ((Vector) pEnum.nextElement()).elements();
+				return vEnum.nextElement();
+			}
+
+			public boolean hasMoreElements() {
+				return next != null;
+			}
+
+			public Object nextElement() {
+				Object result = next;
+				next = findNext();
+				return result;
+			}
+		};
+	}
+
+	public boolean implies(Permission permission) {
+		return false;
+	}
+
+	Vector getPermissions(String name) {
+		return (Vector) permissions.get(name);
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CRL.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CRL.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CRL.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CRL.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,67 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security.cert;
+
+
+/**
+ * This class represents Certificate Revocation Lists (CRLs). They are used to
+ * indicate that a given Certificate has expired already.
+ * 
+ * @see CertificateFactory
+ */
+public abstract class CRL {
+
+	private String type; // Type of this CRL
+
+	/**
+	 * Constructs a new instance of this class for a given CRL type.
+	 * 
+	 * @param type
+	 *            String type of this CRL
+	 */
+	protected CRL(String type) {
+		super();
+		this.type = type;
+	}
+
+	/**
+	 * Answers the type of this CRL.
+	 * 
+	 * @return String the type of this CRL.
+	 */
+	public final String getType() {
+		return type;
+	}
+
+	/**
+	 * Answers if a given Certificate has been revoked or not.
+	 * 
+	 * @param cert
+	 *            Certificate The Certificate to test
+	 * 
+	 * @return true if the certificate has been revoked false if the certificate
+	 *         has not been revoked yet
+	 */
+	public abstract boolean isRevoked(Certificate cert);
+
+	/**
+	 * Answers a string containing a concise, human-readable description of the
+	 * receiver.
+	 * 
+	 * @return a printable representation for the receiver.
+	 */
+	public abstract String toString();
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CRLException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CRLException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CRLException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CRLException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,43 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security.cert;
+
+
+/**
+ * This class indicates that a given certificate was revoked, by a Certificate
+ * Revocation List (CRL).
+ */
+public class CRLException extends java.security.GeneralSecurityException {
+
+	/**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 */
+	public CRLException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public CRLException(String detailMessage) {
+		super(detailMessage);
+	}
+
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertPath.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertPath.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertPath.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertPath.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,225 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security.cert;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.InvalidObjectException;
+import java.io.NotSerializableException;
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * An immutable certificate path that can be validated. All certificates in the
+ * path are of the same type (i.e., X509).
+ * 
+ * A <code>CertPath</code> can be represented as a byte array in at least one
+ * supported encoding when serialized.
+ * 
+ * When a <code>List</code> of the certificates is obtained it must be
+ * immutable.
+ * 
+ * A <code>CertPath</code> must be thread-safe without requiring coordinated
+ * access.
+ */
+public abstract class CertPath implements Serializable {
+
+	private String type;
+
+	/**
+	 * Creates a <code>CertPath</code> of the specified type.
+	 * <code>CertPath</code>s should normally be created via
+	 * <code>CertificateFactory</code>.
+	 * 
+	 * @param type
+	 *            standard name of the <code>Certificate</code> type in the
+	 *            <code>CertPath</code>
+	 */
+	protected CertPath(String type) {
+		this.type = type;
+	}
+
+	/**
+	 * Returns the type of <code>Certificate</code> in the
+	 * <code>CertPath</code>
+	 * 
+	 * @return <code>Certificate</code> type
+	 */
+	public String getType() {
+		return type;
+	}
+
+	/**
+	 * Return an <code>Iterator</code> over the supported encodings for a
+	 * representation of the certificate path.
+	 * 
+	 * @return <code>Iterator</code> over supported encodings (as
+	 *         <code>String</code>s)
+	 */
+	public abstract Iterator getEncodings();
+
+	/**
+	 * Returns true if <code>Certificate</code>s in the list are the same
+	 * type and the lists are equal (and by implication the certificates
+	 * contained within are the same).
+	 * 
+	 * @param other
+	 *            <code>CertPath</code> to be compared for equality
+	 */
+	public boolean equals(Object other) {
+
+		// Test that object is a CertPath
+		if ((other instanceof CertPath) == false) {
+			return false;
+		}
+		CertPath comparePath = (CertPath) other;
+
+		// Compare the certificate types
+		if (comparePath.type != this.type) {
+			return false;
+		}
+
+		// Compare the certificate lists
+		if (comparePath.getCertificates() != this.getCertificates()) {
+			return false;
+		}
+
+		return true;
+	}
+
+	/**
+	 * Returns an immutable List of the <code>Certificate</code>s contained
+	 * in the <code>CertPath</code>.
+	 * 
+	 * @return list of <code>Certificate</code>s in the <code>CertPath</code>
+	 */
+	public abstract List getCertificates();
+
+	/**
+	 * Overrides Object.hashCode() Defined as: hashCode = 31 *
+	 * path.getType().hashCode() + path.getCertificates().hashCode();
+	 * 
+	 * @return hash code for CertPath object
+	 */
+	public int hashCode() {
+		return (31 * this.getType().hashCode())
+				+ this.getCertificates().hashCode();
+	}
+
+	/**
+	 * Returns a <code>String</code> representation of the
+	 * <code>CertPath</code>
+	 * <code>Certificate</code>s. It is the result of
+	 * calling <code>toString</code> on all <code>Certificate</code>s in
+	 * the <code>List</code>. <code>Certificate</code>s
+	 * 
+	 * @return string representation of <code>CertPath</code>
+	 */
+	public String toString() {
+		StringBuffer buffer = new StringBuffer();
+
+		for (Iterator iter = this.getCertificates().iterator(); iter.hasNext();) {
+			Certificate element = (Certificate) iter.next();
+			buffer.append(element.toString());
+		}
+
+		return buffer.toString();
+	}
+
+	/**
+	 * Returns an encoding of the <code>CertPath</code> using the default
+	 * encoding
+	 * 
+	 * @return default encoding of the <code>CertPath</code>
+	 * @throws CertificateEncodingException
+	 */
+	public abstract byte[] getEncoded() throws CertificateEncodingException;
+
+	/**
+	 * Returns an encoding of the <code>CertPath</code> using the specified
+	 * encoding
+	 * 
+	 * @param encoding
+	 *            encoding that should be generated
+	 * @return default encoding of the <code>CertPath</code>
+	 * @throws CertificateEncodingException
+	 */
+	public abstract byte[] getEncoded(String encoding)
+			throws CertificateEncodingException;
+
+	/**
+	 * Returns a <code>CertPath.CertPathRep</code> that can be serialized
+	 * 
+	 * @return CertPath.CertPathRep
+	 * @throws ObjectStreamException
+	 */
+	protected Object writeReplace() throws ObjectStreamException {
+
+		byte[] data;
+		try {
+			data = this.getEncoded(type);
+		} catch (CertificateEncodingException e) {
+			throw new NotSerializableException(e.getMessage());
+		}
+
+		return new CertPathRep(this.type, data);
+
+	}
+
+	/**
+	 * Used for serialization of <code>CertPath</code>
+	 */
+	protected static class CertPathRep implements Serializable {
+
+		private String type;
+
+		private byte[] data;
+
+		/**
+		 * Creates a serializable form of <code>CertPath</code>
+		 * 
+		 * @param type
+		 *            type of the <code>CertPath</code>
+		 * @param data
+		 *            encoded representation of the <code>CertPath</code>
+		 */
+		protected CertPathRep(String type, byte[] data) {
+			this.type = type;
+			this.data = data;
+		}
+
+		/**
+		 * Reads a <code>CertPath</code> from its serialized representation
+		 * 
+		 * @return new <code>CertPath</code> from encoded form
+		 * @throws ObjectStreamException
+		 */
+		protected Object readResolve() throws ObjectStreamException {
+
+			CertPath path;
+			try {
+				CertificateFactory cf = CertificateFactory.getInstance(type);
+				ByteArrayInputStream baos = new ByteArrayInputStream(data);
+				path = cf.generateCertPath(baos);
+			} catch (CertificateException e) {
+				throw new InvalidObjectException(e.getMessage());
+			}
+			return path;
+		}
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/Certificate.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/Certificate.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/Certificate.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/Certificate.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,232 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security.cert;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.InvalidObjectException;
+import java.io.NotSerializableException;
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.PublicKey;
+import java.security.SignatureException;
+import java.util.Arrays;
+import java.util.zip.CRC32;
+
+/**
+ * Abstract class to represent identity certificates. It represents a way to
+ * verify the binding of a Principal and its public key. Examples are X.509,
+ * PGP, and SDSI.
+ */
+public abstract class Certificate implements Serializable {
+	
+	static final long serialVersionUID = -6751606818319535583L;
+
+	private String type; // Type of certificate
+
+	/**
+	 * Constructs a new instance of this class with its type.
+	 * 
+	 * @param type
+	 *            String Type of certificate
+	 */
+	protected Certificate(String type) {
+		this.type = type;
+	}
+
+	/**
+	 * Compares the argument to the receiver, and answers true if they represent
+	 * the <em>same</em> object using a class specific comparison. The
+	 * implementation in Object answers true only if the argument is the exact
+	 * same object as the receiver (==).
+	 * 
+	 * @param o
+	 *            the object to compare with this object
+	 * @return <code>true</code> if the object is the same as this object
+	 *         <code>false</code> if it is different from this object
+	 * @see #hashCode
+	 */
+	public boolean equals(Object o) {
+		if (o == null)
+			return false;
+
+		Certificate c = null;
+		try {
+			c = (Certificate) o;
+		} catch (ClassCastException e) {
+			return false;
+		}
+
+		try {
+			return Arrays.equals(this.getEncoded(), c.getEncoded());
+		} catch (CertificateEncodingException cee) {
+			return false;
+		}
+	}
+
+	/**
+	 * Answers the encoded representation for this certificate.
+	 * 
+	 * @return the encoded representation for this certificate.
+	 */
+	public abstract byte[] getEncoded() throws CertificateEncodingException;
+
+	/**
+	 * Answers the public key corresponding to this certificate.
+	 * 
+	 * @return the public key corresponding to this certificate.
+	 */
+	public abstract PublicKey getPublicKey();
+
+	/**
+	 * Answers the certificate type represented by the receiver.
+	 * 
+	 * @return the certificate type represented by the receiver.
+	 */
+	public final String getType() {
+		return type;
+	}
+
+	/**
+	 * Answers an integer hash code for the receiver. Any two objects which
+	 * answer <code>true</code> when passed to <code>equals</code> must
+	 * answer the same value for this method.
+	 * 
+	 * @return the receiver's hash
+	 * 
+	 * @see #equals
+	 */
+	public int hashCode() {
+		try {
+			CRC32 hash = new CRC32();
+			hash.update(getEncoded());
+			return (int) hash.getValue();
+		} catch (CertificateEncodingException cee) {
+			return super.hashCode();
+		}
+	}
+
+	/**
+	 * Answers a string containing a concise, human-readable description of the
+	 * receiver.
+	 * 
+	 * @return a printable representation for the receiver.
+	 */
+	public abstract String toString();
+
+	/**
+	 * Verifies that this certificate was signed with the given public key.
+	 * 
+	 * @param key
+	 *            PublicKey public key for which verification should be
+	 *            performed.
+	 * 
+	 * @exception CertificateException
+	 *                if encoding errors are detected
+	 * @exception NoSuchAlgorithmException
+	 *                if an unsupported algorithm is detected
+	 * @exception InvalidKeyException
+	 *                if an invalid key is detected
+	 * @exception NoSuchProviderException
+	 *                if there is no default provider
+	 * @exception SignatureException
+	 *                if signature errors are detected
+	 */
+	public abstract void verify(PublicKey key) throws CertificateException,
+			NoSuchAlgorithmException, InvalidKeyException,
+			NoSuchProviderException, SignatureException;
+
+	/**
+	 * Verifies that this certificate was signed with the given public key. Uses
+	 * the signature algorithm given by the provider.
+	 * 
+	 * @param key
+	 *            PublicKey public key for which verification should be
+	 *            performed.
+	 * @param sigProvider
+	 *            String the name of teh signature provider.
+	 * 
+	 * @exception CertificateException
+	 *                if encoding errors are detected
+	 * @exception NoSuchAlgorithmException
+	 *                if an unsupported algorithm is detected
+	 * @exception InvalidKeyException
+	 *                if an invalid key is detected
+	 * @exception NoSuchProviderException
+	 *                if there is no default provider
+	 * @exception SignatureException
+	 *                if signature errors are detected
+	 */
+	public abstract void verify(PublicKey key, String sigProvider)
+			throws CertificateException, NoSuchAlgorithmException,
+			InvalidKeyException, NoSuchProviderException, SignatureException;
+
+	/**
+	 * Representation of a Certificate used for serialization.
+	 */
+	protected static class CertificateRep implements Serializable {
+
+		static final long serialVersionUID = -8563758940495660020L;
+
+		String type;
+
+		byte[] data;
+
+		/**
+		 * Create this representation of a certificate.
+		 * 
+		 * @param type
+		 *            the type of the certificate
+		 * @param encoded
+		 *            the encoded representation of the certificate
+		 */
+		protected CertificateRep(String type, byte[] encoded) {
+			this.type = type;
+			data = encoded;
+		}
+
+		/**
+		 * Return the certificate represented by the receiver.
+		 */
+		protected Object readResolve() throws ObjectStreamException {
+			try {
+				CertificateFactory factory = CertificateFactory
+						.getInstance(type);
+				Certificate certificate = factory
+						.generateCertificate(new ByteArrayInputStream(data));
+				return certificate;
+			} catch (CertificateException e) {
+				throw new InvalidObjectException(e.toString());
+			}
+		}
+	}
+
+	/**
+	 * Return a representation of the receiver for serialization.
+	 */
+	protected Object writeReplace() throws ObjectStreamException {
+		byte[] encoded = null;
+		try {
+			encoded = getEncoded();
+		} catch (CertificateEncodingException e) {
+			throw new NotSerializableException(e.toString());
+		}
+		return new CertificateRep(type, encoded);
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateEncodingException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateEncodingException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateEncodingException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateEncodingException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,42 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security.cert;
+
+
+/**
+ * This class represents an encoding exception for a certificate.
+ */
+public class CertificateEncodingException extends CertificateException {
+
+	/**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 */
+	public CertificateEncodingException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public CertificateEncodingException(String detailMessage) {
+		super(detailMessage);
+	}
+
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,44 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security.cert;
+
+
+import java.security.GeneralSecurityException;
+
+/**
+ * This class represents a general certificate exception.
+ */
+public class CertificateException extends
+		GeneralSecurityException {
+
+	/**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 */
+	public CertificateException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public CertificateException(String detailMessage) {
+		super(detailMessage);
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateExpiredException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateExpiredException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateExpiredException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateExpiredException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,41 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security.cert;
+
+
+/**
+ * This class indicates that a given certificate has expired.
+ */
+public class CertificateExpiredException extends CertificateException {
+
+	/**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 */
+	public CertificateExpiredException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public CertificateExpiredException(String detailMessage) {
+		super(detailMessage);
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateFactory.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateFactory.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateFactory.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateFactory.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,484 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security.cert;
+
+
+import java.io.InputStream;
+import java.security.NoSuchProviderException;
+import java.security.Provider;
+import java.security.Security;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+
+import com.ibm.oti.util.Msg;
+
+/**
+ * This class provides the functionality of a certificate factory algorithm.
+ */
+public class CertificateFactory {
+
+	// Key prefix for algorithm name lookup
+	private static final String KEY_PREFIX = "CertificateFactory.";
+
+	// Certificate type being used
+	private String type;
+
+	// Provider of the key algorithm represented by the receiver
+	private Provider provider;
+
+	// The actual provider-supplied implementation
+	private CertificateFactorySpi certificateFactorySpi;
+
+	/**
+	 * Constructs a new instance of this class with the algorithm provided.
+	 * 
+	 * @param certFacSpi
+	 *            CertificateFactorySpi The actual certificate factory
+	 *            implementation
+	 * @param provider
+	 *            Provider The provider of the certificate factory
+	 * @param type
+	 *            String Certificate type
+	 */
+	protected CertificateFactory(CertificateFactorySpi certFacSpi,
+			Provider provider, String type) {
+		super();
+		setProvider(provider);
+		setType(type);
+		this.certificateFactorySpi = certFacSpi;
+	}
+
+	/**
+	 * Creates a CertificateFactory for a given CertificateFactorySpi from a
+	 * provider
+	 * 
+	 * @param provider
+	 *            Provider The provider that is supplying the implementation for
+	 *            the service
+	 * @param certClass
+	 *            Class The class that implements the type wanted
+	 * @param type
+	 *            String The type desired
+	 * 
+	 * @return a CertificateFactory for a given CertificateFactorySpi from a
+	 *         provider
+	 * 
+	 * @throws CertificateException
+	 *             if parsing problems are detected
+	 */
+	private static CertificateFactory createCertificateFactory(
+			Provider provider, Class certClass, String type)
+			throws CertificateException {
+		try {
+			CertificateFactorySpi providedCertificateFactory = (CertificateFactorySpi) certClass
+					.newInstance();
+			return new CertificateFactory(providedCertificateFactory, provider,
+					type);
+		} catch (IllegalAccessException e) {
+		} catch (InstantiationException e) {
+		}
+
+		throw new CertificateException(type);
+	}
+
+	/**
+	 * Generates and initializes a Certificate from data from the provided input
+	 * stream.
+	 * 
+	 * @param inStream
+	 *            InputStream Stream from where data is read to create the
+	 *            Certificate
+	 * 
+	 * @return Certificate an initialized Certificate
+	 * @exception CertificateException
+	 *                if parsing problems are detected
+	 */
+	public final Certificate generateCertificate(InputStream inStream)
+			throws CertificateException {
+		if (inStream == null) {
+			throw new CertificateException(Msg.getString("K00a5", "null"));
+		}
+
+		return certificateFactorySpi.engineGenerateCertificate(inStream);
+	}
+
+	/**
+	 * Generates and initializes a collection of Certificates from data from the
+	 * provided input stream.
+	 * 
+	 * @param inStream
+	 *            InputStream Stream from where data is read to create the
+	 *            Certificates
+	 * 
+	 * @return Collection an initialized collection of Certificates
+	 * @exception CertificateException
+	 *                if parsing problems are detected
+	 */
+	public final Collection generateCertificates(InputStream inStream)
+			throws CertificateException {
+		if (inStream == null) {
+			throw new CertificateException(Msg.getString("K00a5", "null"));
+		}
+
+		return certificateFactorySpi.engineGenerateCertificates(inStream);
+	}
+
+	/**
+	 * Generates and initializes a Certificate Revocation List from data from
+	 * the provided input stream.
+	 * 
+	 * @param inStream
+	 *            InputStream Stream from where data is read to create the CRL
+	 * 
+	 * @return CRL an initialized Certificate Revocation List
+	 * @exception CRLException
+	 *                if parsing problems are detected
+	 */
+	public final CRL generateCRL(InputStream inStream) throws CRLException {
+
+		if (inStream == null) {
+			throw new CRLException(Msg.getString("K00a5", "null"));
+		}
+		return certificateFactorySpi.engineGenerateCRL(inStream);
+	}
+
+	/**
+	 * Generates a <code>CertPath</code> from data from the provided
+	 * <code>InputStream</code>. The default encoding is assumed.
+	 * 
+	 * @param inStream
+	 *            InputStream with PKCS7 or PkiPath encoded data
+	 * 
+	 * @return CertPath a CertPath initialized from the provided data
+	 * 
+	 * @throws CertificateException
+	 *             if parsing problems are detected
+	 */
+	public final CertPath generateCertPath(InputStream inStream)
+			throws CertificateException {
+		if (inStream == null) {
+			throw new CertificateException(Msg.getString("K00a5", "null"));
+		}
+
+		return certificateFactorySpi.engineGenerateCertPath(inStream);
+	}
+
+	/**
+	 * Generates a <code>CertPath</code> from data from the provided
+	 * <code>InputStream</code>. The encoding is that specified by the
+	 * encoding parameter.
+	 * 
+	 * @param inStream
+	 *            InputStream containing certificate path data in specified
+	 *            encoding
+	 * @param encoding
+	 *            encoding of the data in the input stream
+	 * 
+	 * @return CertPath a CertPath initialized from the provided data
+	 * 
+	 * @throws CertificateException
+	 *             if parsing problems are detected
+	 * @throws UnsupportedOperationException
+	 *             if the provider does not implement this method
+	 */
+	public final CertPath generateCertPath(InputStream inStream, String encoding)
+			throws CertificateException {
+		if (inStream == null) {
+			throw new CertificateException(Msg.getString("K00a5", "null"));
+		}
+		if (encoding == null) {
+			throw new CertificateException(Msg.getString("K00a5", encoding));
+		}
+
+		return certificateFactorySpi.engineGenerateCertPath(inStream, encoding);
+	}
+
+	/**
+	 * Generates a <code>CertPath</code> from the provided List of
+	 * Certificates. The encoding is the default encoding.
+	 * 
+	 * @param certificates
+	 *            List containing certificates in a format supported by the
+	 *            CertificateFactory
+	 * 
+	 * @return CertPath a CertPath initialized from the provided data
+	 * 
+	 * @throws CertificateException
+	 *             if parsing problems are detected
+	 * @throws UnsupportedOperationException
+	 *             if the provider does not implement this method
+	 */
+	public final CertPath generateCertPath(List certificates)
+			throws CertificateException {
+		if (certificates == null) {
+			throw new CertificateException(Msg.getString("K00a5", "null"));
+		}
+		return certificateFactorySpi.engineGenerateCertPath(certificates);
+	}
+
+	/**
+	 * Returns an Iterator over the supported CertPath encodings (as Strings).
+	 * The first element is the default encoding.
+	 * 
+	 * @return Iterator Iterator over supported CertPath encodings (as Strings)
+	 */
+	public final Iterator getCertPathEncodings() {
+		return certificateFactorySpi.engineGetCertPathEncodings();
+	}
+
+	/**
+	 * Generates and initializes a collection of Certificate Revocation List
+	 * from data from the provided input stream.
+	 * 
+	 * @param inStream
+	 *            InputStream Stream from where data is read to create the CRLs
+	 * 
+	 * @return Collection an initialized collection of Certificate Revocation
+	 *         List
+	 * @exception CRLException
+	 *                if parsing problems are detected
+	 */
+	public final Collection generateCRLs(InputStream inStream)
+			throws CRLException {
+		if (inStream == null) {
+			throw new CRLException(Msg.getString("K00a5", "null"));
+		}
+		return certificateFactorySpi.engineGenerateCRLs(inStream);
+	}
+
+	/**
+	 * Answers a new CertificateFactory of the given type.
+	 * 
+	 * @param type
+	 *            java.lang.String Type of certificate desired
+	 * @return CertificateFactory a concrete implementation for the certificate
+	 *         type desired.
+	 * 
+	 * @exception CertificateException
+	 *                If the type cannot be found
+	 */
+	public static final CertificateFactory getInstance(String type)
+			throws CertificateException {
+		// *** NOTE *** - This method is declared to return CertificateFactory,
+		// while providers are supposed to subclass CertificateFactorySpi. So,
+		// we cannot simply return an instance of a subclass of
+		// CertificateFactorySpi. This is why we have the instance variable
+		// pointing to the actual implementation
+
+		if (type == null)
+			throw new CertificateException(Msg.getString("K0337"));
+
+		return toCertificateFactoryImplementation(type);
+	}
+
+	/**
+	 * Answers a new CertificateFactory of the given type.
+	 * 
+	 * @param type
+	 *            java.lang.String Type of certificatem desired
+	 * @param providerName
+	 *            java.lang.String Name of the provider which has to implement
+	 *            the algorithm
+	 * @return CertificateFactory a concrete implementation for the certificate
+	 *         type desired.
+	 * 
+	 * @exception CertificateException
+	 *                If the type cannot be found
+	 * @exception NoSuchProviderException
+	 *                If the provider cannot be found
+	 */
+	public static final CertificateFactory getInstance(String type,
+			String providerName) throws CertificateException,
+			NoSuchProviderException {
+		// *** NOTE *** - This method is declared to return CertificateFactory,
+		// while providers are supposed to subclass CertificateFactorySpi. So,
+		// we cannot simply return an instance of a subclass of
+		// CertificateFactorySpi. This is why we have the instance variable
+		// pointing to the actual implementation
+
+		if (providerName == null)
+			throw new java.lang.IllegalArgumentException();
+
+		if (type == null)
+			throw new CertificateException(Msg.getString("K0337"));
+
+		Provider provider = Security.getProvider(providerName);
+		if (provider == null)
+			throw new NoSuchProviderException(providerName);
+
+		return toCertificateFactoryImplementation(type, provider);
+	}
+
+	/**
+	 * Answers a new CertificateFactory of the given type.
+	 * 
+	 * @param type
+	 *            java.lang.String Type of certificatem desired
+	 * @param provider
+	 *            java.security.Provider Provider which has to implement the
+	 *            algorithm
+	 * @return CertificateFactory a concrete implementation for the certificate
+	 *         type desired.
+	 * 
+	 * @exception CertificateException
+	 *                If the type cannot be found
+	 */
+	public static final CertificateFactory getInstance(String type,
+			Provider provider) throws CertificateException {
+		if (type == null)
+			throw new CertificateException(Msg.getString("K0337"));
+
+		if (provider == null) {
+			throw new IllegalArgumentException();
+		}
+
+		return toCertificateFactoryImplementation(type, provider);
+	}
+
+	/**
+	 * Returns the Provider of the certificate factory represented by the
+	 * receiver.
+	 * 
+	 * @return Provider an instance of a subclass of java.security.Provider
+	 */
+	public final Provider getProvider() {
+		return provider;
+	}
+
+	/**
+	 * Returns the Certificate type
+	 * 
+	 * @return String type of certificate being used
+	 */
+	public final String getType() {
+		return type;
+	}
+
+	/**
+	 * Set the provider being used by the receiver to the argument which should
+	 * be an instance of a subclass of Provider
+	 * 
+	 * @param provider
+	 *            the Provider for the receiver
+	 */
+	void setProvider(Provider provider) {
+		this.provider = provider;
+	}
+
+	/**
+	 * Set the certificate type being used by the receiver to the argument.
+	 * 
+	 * @param type
+	 *            String the type of the certificate
+	 */
+	void setType(String type) {
+		this.type = type;
+	}
+
+	/**
+	 * Answers a CertificateFactory for the type name
+	 * 
+	 * @param type
+	 *            java.lang.String the type of certificate desired
+	 * 
+	 * @return The CertificateFactory for the type name .
+	 * @throws CertificateException
+	 *             If the requested type is not available
+	 */
+	private static CertificateFactory toCertificateFactoryImplementation(
+			String type) throws CertificateException {
+
+		Provider[] providers = Security.getProviders();
+		for (int i = 0; i < providers.length; i++) {
+			Provider provider = providers[i];
+			try {
+				return toCertificateFactoryImplementation(type, provider);
+			} catch (CertificateException e) {
+				// Just skip to next provider
+			}
+		}
+
+		// Scanned all, found nothing
+		throw new CertificateException(type);
+	}
+
+	/**
+	 * Answers a CertificateFactory for the type name
+	 * 
+	 * @param type
+	 *            java.lang.String the type of certificate desired
+	 * 
+	 * @param provider
+	 *            java.security.Provider the provider desired for the type.
+	 * 
+	 * @return The CertificateFactory for the type name .
+	 * @throws CertificateException
+	 *             If the requested type is not available
+	 */
+	private static CertificateFactory toCertificateFactoryImplementation(
+			String type, Provider provider) throws CertificateException {
+
+		// First try to find the class corresponding to the algorithm name
+		String certificateFactoryClassName;
+		try {
+			certificateFactoryClassName = lookupProperty(provider, KEY_PREFIX,
+					type);
+		} catch (ClassCastException e) {
+			throw new CertificateException(type);
+		}
+
+		// If not found, exception
+		if (certificateFactoryClassName == null)
+			throw new CertificateException(type);
+
+		// Now try to instantiate the certificate factory.
+		try {
+			Class certFactClass = Class.forName(certificateFactoryClassName,
+					true, provider.getClass().getClassLoader());
+			return createCertificateFactory(provider, certFactClass, type);
+		} catch (ClassNotFoundException ex) {
+			throw new CertificateException(type);
+		}
+	}
+
+	private static String lookupProperty(Provider provider, String property) {
+		String result = provider.getProperty(property);
+		if (result != null)
+			return result;
+		String upper = property.toUpperCase();
+		Enumeration keyEnum = provider.keys();
+		while (keyEnum.hasMoreElements()) {
+			String key = (String) keyEnum.nextElement();
+			if (key.toUpperCase().equals(upper))
+				return provider.getProperty(key);
+		}
+		return null;
+	}
+
+	private static String lookupProperty(Provider provider, String prefix,
+			String name) {
+		String property = prefix + name;
+		String result = lookupProperty(provider, property);
+		if (result != null)
+			return result;
+		result = lookupProperty(provider, "Alg.Alias." + property);
+		if (result != null)
+			return provider.getProperty(prefix + result);
+		return null;
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateFactorySpi.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateFactorySpi.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateFactorySpi.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateFactorySpi.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,169 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security.cert;
+
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This class is a Service Provider Interface (therefore the Spi suffix) for
+ * certificate factories to be supplied by providers.
+ */
+public abstract class CertificateFactorySpi {
+	/**
+	 * Constructs a new instance of this class.
+	 */
+	public CertificateFactorySpi() {
+		super();
+	}
+
+	/**
+	 * Generates and initializes a Certificate from data from the provided input
+	 * stream.
+	 * 
+	 * @param inStream
+	 *            InputStream Stream from where data is read to create the
+	 *            Certificate
+	 * 
+	 * @return Certificate an initialized Certificate
+	 * @exception CertificateException
+	 *                if parsing problems are detected
+	 */
+	public abstract Certificate engineGenerateCertificate(InputStream inStream)
+			throws CertificateException;
+
+	/**
+	 * Generates and initializes a collection of Certificates from data from the
+	 * provided input stream.
+	 * 
+	 * @param inStream
+	 *            InputStream Stream from where data is read to create the
+	 *            Certificates
+	 * 
+	 * @return Collection an initialized collection of Certificates
+	 * @exception CertificateException
+	 *                if parsing problems are detected
+	 */
+	public abstract Collection engineGenerateCertificates(InputStream inStream)
+			throws CertificateException;
+
+	/**
+	 * Generates and initializes a Certificate Revocation List from data from
+	 * the provided input stream.
+	 * 
+	 * @param inStream
+	 *            InputStream Stream from where data is read to create the CRL
+	 * 
+	 * @return CRL an initialized Certificate Revocation List
+	 * @exception CRLException
+	 *                if parsing problems are detected
+	 */
+	public abstract CRL engineGenerateCRL(InputStream inStream)
+			throws CRLException;
+
+	/**
+	 * Generates and initializes a collection of Certificate Revocation List
+	 * from data from the provided input stream.
+	 * 
+	 * @param inStream
+	 *            InputStream Stream from where data is read to create the CRLs
+	 * 
+	 * @return Collection an initialized collection of Certificate Revocation
+	 *         List
+	 * @exception CRLException
+	 *                if parsing problems are detected
+	 */
+	public abstract Collection engineGenerateCRLs(InputStream inStream)
+			throws CRLException;
+
+	/**
+	 * Returns an Iterator over the supported CertPath encodings (as Strings).
+	 * The first element is the default encoding.
+	 * 
+	 * @return Iterator Iterator over supported CertPath encodings (as Strings)
+	 */
+	public Iterator engineGetCertPathEncodings() {
+		throw new UnsupportedOperationException();
+	}
+
+	/**
+	 * Generates a <code>CertPath</code> from data from the provided
+	 * <code>InputStream</code>. The default encoding is assumed.
+	 * 
+	 * @param inStream
+	 *            InputStream with PKCS7 or PkiPath encoded data
+	 * 
+	 * @return CertPath a CertPath initialized from the provided data
+	 * 
+	 * @throws CertificateException
+	 *             if parsing problems are detected
+	 */
+	public CertPath engineGenerateCertPath(InputStream inStream)
+			throws CertificateException {
+		Collection certificates = engineGenerateCertificates(inStream);
+		List certList = new ArrayList(certificates);
+		return engineGenerateCertPath(certList);
+	}
+
+	/**
+	 * Generates a <code>CertPath</code> from data from the provided
+	 * <code>InputStream</code>. The encoding is that specified by the
+	 * encoding parameter.
+	 * 
+	 * @param inStream
+	 *            InputStream containing certificate path data in specified
+	 *            encoding
+	 * @param encoding
+	 *            encoding of the data in the input stream
+	 * 
+	 * @return CertPath a CertPath initialized from the provided data
+	 * 
+	 * @throws CertificateException
+	 *             if parsing problems are detected
+	 * @throws UnsupportedOperationException
+	 *             if the provider does not implement this method
+	 */
+	public CertPath engineGenerateCertPath(InputStream inStream, String encoding)
+			throws CertificateException {
+		
+		throw new UnsupportedOperationException();
+	}
+
+	/**
+	 * Generates a <code>CertPath</code> from the provided List of
+	 * Certificates. The encoding is the default encoding.
+	 * 
+	 * @param certificates
+	 *            List containing certificates in a format supported by the
+	 *            CertificateFactory
+	 * 
+	 * @return CertPath a CertPath initialized from the provided data
+	 * 
+	 * @throws CertificateException
+	 *             if parsing problems are detected
+	 * @throws UnsupportedOperationException
+	 *             if the provider does not implement this method
+	 */
+	public CertPath engineGenerateCertPath(List certificates)
+			throws CertificateException {
+		
+		throw new UnsupportedOperationException();
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateNotYetValidException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateNotYetValidException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateNotYetValidException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateNotYetValidException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,42 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security.cert;
+
+
+/**
+ * This class indicates that a given certificate is not valid yet.
+ */
+public class CertificateNotYetValidException extends CertificateException {
+
+	/**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 */
+	public CertificateNotYetValidException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public CertificateNotYetValidException(String detailMessage) {
+		super(detailMessage);
+	}
+
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateParsingException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateParsingException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateParsingException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/security/src/java/security/cert/CertificateParsingException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,41 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.security.cert;
+
+
+/**
+ * This class indicates that a given certificate could not be parsed.
+ */
+public class CertificateParsingException extends CertificateException {
+
+	/**
+	 * Constructs a new instance of this class with its walkback filled in.
+	 */
+	public CertificateParsingException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new instance of this class with its walkback and message
+	 * filled in.
+	 * 
+	 * @param detailMessage
+	 *            String The detail message for the exception.
+	 */
+	public CertificateParsingException(String detailMessage) {
+		super(detailMessage);
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/META-INF/MANIFEST.MF?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/META-INF/MANIFEST.MF (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/META-INF/MANIFEST.MF Wed Nov 30 21:29:27 2005
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Harmony Text
+Bundle-SymbolicName: org.apache.harmony.text
+Bundle-Version: 1.0.0
+Bundle-ClassPath: .
+Eclipse-JREBundle: true
+Export-Package: java.text
+Import-Package: java.lang,
+ java.util, 
+ java.net, 
+ java.io, 
+ java.security, 
+ com.ibm.oti.util
+Require-Bundle: org.apache.harmony.luni,
+ org.apache.harmony.security

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/com/ibm/text/BidiRun.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/com/ibm/text/BidiRun.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/com/ibm/text/BidiRun.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/com/ibm/text/BidiRun.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,53 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.ibm.text;
+
+
+/**
+ * TODO: type description
+ */
+public class BidiRun {
+	private final int start;
+
+	private final int limit;
+
+	private final int level;
+
+	public BidiRun(int start, int limit, int level) {
+		this.start = start;
+		this.limit = limit;
+		this.level = level;
+	}
+
+	public int getLevel() {
+		return level;
+	}
+
+	public int getLimit() {
+		return limit;
+	}
+
+	public int getStart() {
+		return start;
+	}
+
+	public boolean equals(Object o) {
+		return o == null || o.getClass() != BidiRun.class ? false
+				: this.start == ((BidiRun) o).start
+						&& this.limit == ((BidiRun) o).limit
+						&& this.level == ((BidiRun) o).level;
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/com/ibm/text/BidiWrapper.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/com/ibm/text/BidiWrapper.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/com/ibm/text/BidiWrapper.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/com/ibm/text/BidiWrapper.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,86 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.ibm.text;
+
+
+/**
+ * TODO: type description
+ */
+
+public final class BidiWrapper {
+
+	public static final int UBIDI_DEFAULT_LTR = 0xfe;
+
+	public static final int UBIDI_DEFAULT_RTL = 0xff;
+
+	public static final int UBIDI_MAX_EXPLICIT_LEVEL = 61;
+
+	public static final int UBIDI_LEVEL_OVERRIDE = 0x80;
+
+	public static final int UBIDI_KEEP_BASE_COMBINING = 1;
+
+	public static final int UBIDI_DO_MIRRORING = 2;
+
+	public static final int UBIDI_INSERT_LRM_FOR_NUMERIC = 4;
+
+	public static final int UBIDI_REMOVE_BIDI_CONTROLS = 8;
+
+	public static final int UBIDI_OUTPUT_REVERSE = 16;
+
+	public static final int UBiDiDirection_UBIDI_LTR = 0;
+
+	public static final int UBiDiDirection_UBIDI_RTL = 1;
+
+	public static final int UBiDiDirection_UBIDI_MIXED = 2;
+
+	// Allocate a UBiDi structure.
+	public static native long ubidi_open();
+
+	// ubidi_close() must be called to free the memory associated with a
+	// UBiDi object.
+	public static native void ubidi_close(long pBiDi);
+
+	// Perform the Unicode BiDi algorithm.
+	public static native void ubidi_setPara(long pBiDi, char[] text,
+			int length, byte paraLevel, byte[] embeddingLevels);
+
+	// ubidi_setLine() sets a UBiDi to contain the reordering information,
+	// especially the resolved levels, for all the characters in a line of
+	// text.
+	public static native long ubidi_setLine(final long pParaBiDi, int start,
+			int limit);
+
+	// Get the directionality of the text.
+	public static native int ubidi_getDirection(final long pBiDi);
+
+	// Get the length of the text.
+	public static native int ubidi_getLength(final long pBiDi);
+
+	// Get the paragraph level of the text.
+	public static native byte ubidi_getParaLevel(final long pBiDi);
+
+	// Get an array of levels for each character.
+	public static native byte[] ubidi_getLevels(long pBiDi);
+
+	// Get the number of runs.
+	public static native int ubidi_countRuns(long pBiDi);
+
+	// Get the BidiRun of the nth logical run
+	public static native BidiRun ubidi_getRun(long pBidi, int index);
+
+	// This is a convenience function that does not use a UBiDi object
+	public static native int[] ubidi_reorderVisual(byte[] levels, int length);
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/java/text/Annotation.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/java/text/Annotation.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/java/text/Annotation.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/java/text/Annotation.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,37 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.text;
+
+
+/**
+ * Annotation
+ */
+public class Annotation {
+
+	private Object value;
+
+	public Annotation(Object attribute) {
+		value = attribute;
+	}
+
+	public Object getValue() {
+		return value;
+	}
+
+	public String toString() {
+		return getClass().getName() + "[value=" + value + ']';
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/java/text/AttributedCharacterIterator.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/java/text/AttributedCharacterIterator.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/java/text/AttributedCharacterIterator.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/text/src/java/text/AttributedCharacterIterator.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,96 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.text;
+
+
+import java.io.InvalidObjectException;
+import java.io.Serializable;
+import java.util.Map;
+import java.util.Set;
+
+import com.ibm.oti.util.Msg;
+
+/**
+ * AttributedCharacterIterator
+ */
+public interface AttributedCharacterIterator extends CharacterIterator {
+
+	public static class Attribute implements Serializable {
+
+		static final long serialVersionUID = -9142742483513960612L;
+
+		public static final Attribute INPUT_METHOD_SEGMENT = new Attribute(
+				"input_method_segment");
+
+		public static final Attribute LANGUAGE = new Attribute("language");
+
+		public static final Attribute READING = new Attribute("reading");
+
+		private String name;
+
+		protected Attribute(String name) {
+			this.name = name;
+		}
+
+		public final boolean equals(Object object) {
+			if (object == null || !(object.getClass().equals(this.getClass())))
+				return false;
+			return name.equals(((Attribute) object).name);
+		}
+
+		protected String getName() {
+			return name;
+		}
+
+		public final int hashCode() {
+			return name.hashCode();
+		}
+
+		protected Object readResolve() throws InvalidObjectException {
+			if (this.getClass() != Attribute.class)
+				throw new InvalidObjectException(Msg.getString("K000c"));
+			if (this.equals(INPUT_METHOD_SEGMENT))
+				return INPUT_METHOD_SEGMENT;
+			if (this.equals(LANGUAGE))
+				return LANGUAGE;
+			if (this.equals(READING))
+				return READING;
+			throw new InvalidObjectException(Msg.getString("K000d"));
+		}
+
+		public String toString() {
+			return getClass().getName() + '(' + getName() + ')';
+		}
+	}
+
+	public Set getAllAttributeKeys();
+
+	public Object getAttribute(Attribute attribute);
+
+	public Map getAttributes();
+
+	public int getRunLimit();
+
+	public int getRunLimit(Attribute attribute);
+
+	public int getRunLimit(Set attributes);
+
+	public int getRunStart();
+
+	public int getRunStart(Attribute attribute);
+
+	public int getRunStart(Set attributes);
+}



Mime
View raw message