harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r450032 [2/6] - in /incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java: common/java/security/ common/java/security/cert/ common/java/security/spec/ common/javax/security/cert/ common/org/apache/harmony/security/ common...
Date Tue, 26 Sep 2006 12:46:21 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/MessageDigest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/MessageDigest.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/MessageDigest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/MessageDigest.java Tue Sep 26 05:46:11 2006
@@ -24,6 +24,7 @@
 import java.nio.ByteBuffer;
 
 import org.apache.harmony.security.fortress.Engine;
+import org.apache.harmony.security.internal.nls.Messages;
 
 
 /**
@@ -34,7 +35,7 @@
 public abstract class MessageDigest extends MessageDigestSpi {
     
     // The service name
-    private static final String SERVICE = "MessageDigest";
+    private static final String SERVICE = "MessageDigest"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
@@ -60,7 +61,7 @@
     public static MessageDigest getInstance(String algorithm)
             throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
         }
         MessageDigest result;
         synchronized (engine) {
@@ -85,13 +86,11 @@
     public static MessageDigest getInstance(String algorithm, String provider)
             throws NoSuchAlgorithmException, NoSuchProviderException {
         if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException(
-                    "Provider is null or empty string");
+            throw new IllegalArgumentException(Messages.getString("security.02")); //$NON-NLS-1$
         }
         Provider p = Security.getProvider(provider);
         if (p == null) {
-            throw new NoSuchProviderException("Provider " + provider
-                    + " is not available");
+            throw new NoSuchProviderException(Messages.getString("security.03", provider)); //$NON-NLS-1$
         }
         return getInstance(algorithm, p);
     }
@@ -115,10 +114,10 @@
     public static MessageDigest getInstance(String algorithm, Provider provider)
             throws NoSuchAlgorithmException {
         if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
+            throw new IllegalArgumentException(Messages.getString("security.04")); //$NON-NLS-1$
         }
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
         }
         MessageDigest result;
         synchronized (engine) {
@@ -166,8 +165,7 @@
     public void update(byte[] input, int offset, int len) {
         if (input == null || offset < 0 || len < 0 ||
                 (long)offset + (long)len > input.length) {
-            throw new IllegalArgumentException(
-                    "Incorrect offset/len parameters");
+            throw new IllegalArgumentException(Messages.getString("security.05")); //$NON-NLS-1$
         }
         engineUpdate(input, offset, len);
     }
@@ -178,7 +176,7 @@
      */
     public void update(byte[] input) {
         if (input == null) {
-            throw new NullPointerException("Null input parameter");
+            throw new NullPointerException(Messages.getString("security.06")); //$NON-NLS-1$
         }
         engineUpdate(input, 0, input.length);
     }
@@ -202,8 +200,7 @@
     public int digest(byte[] buf, int offset, int len) throws DigestException {
         if (buf == null || offset < 0 || len < 0 ||
                 (long)offset + (long)len > buf.length) {
-            throw new IllegalArgumentException(
-                    "Incorrect offset/len parameters");
+            throw new IllegalArgumentException(Messages.getString("security.05")); //$NON-NLS-1$
         }
         return engineDigest(buf, offset, len);
     }
@@ -224,7 +221,7 @@
      * @return a printable representation for the receiver.
      */
     public String toString() {
-        return "MESSAGE DIGEST " + algorithm;
+        return "MESSAGE DIGEST " + algorithm; //$NON-NLS-1$
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/MessageDigestSpi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/MessageDigestSpi.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/MessageDigestSpi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/MessageDigestSpi.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 
 import java.nio.ByteBuffer;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 
 /**
  * This class is a Service Provider Interface (therefore the Spi suffix) for
@@ -92,20 +94,20 @@
                     throws DigestException {
         if (len < engineGetDigestLength()) {
             engineReset();
-            throw new DigestException("The value of len parameter is less than the actual digest length"); 
+            throw new DigestException(Messages.getString("security.1B"));  //$NON-NLS-1$
         }
         if (offset < 0) {
             engineReset();
-            throw new DigestException("Invalid negative offset");
+            throw new DigestException(Messages.getString("security.1C")); //$NON-NLS-1$
         }
         if (offset + len > buf.length) {
             engineReset();
-            throw new DigestException("Incorrect offset or len value");
+            throw new DigestException(Messages.getString("security.1D")); //$NON-NLS-1$
         }
         byte tmp[] = engineDigest();
         if (tmp != null) {
             if (len < tmp.length ) {
-                throw new DigestException("The value of len parameter is less than the actual digest length.");
+                throw new DigestException(Messages.getString("security.1B")); //$NON-NLS-1$
             }
             System.arraycopy(tmp, 0, buf, offset, tmp.length);
             return tmp.length;            

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permission.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permission.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permission.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permission.java Tue Sep 26 05:46:11 2006
@@ -128,8 +128,8 @@
 	 */
     public String toString() {
         String actions = getActions();
-        actions = (actions == null || actions.length() == 0) ? "" : " "
+        actions = (actions == null || actions.length() == 0) ? "" : " " //$NON-NLS-1$ //$NON-NLS-2$
                 + getActions();
-        return "(" + getClass().getName() + " " + getName() + actions + ")";
+        return "(" + getClass().getName() + " " + getName() + actions + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java Tue Sep 26 05:46:11 2006
@@ -119,10 +119,10 @@
         totalLength += esize * 4;
         //FIXME StringBuffer --> StringBuilder
         StringBuffer result = new StringBuffer(totalLength).append(superStr)
-            .append(" (");
+            .append(" ("); //$NON-NLS-1$
         for (int i = 0; i < esize; i++) {
-            result.append("\n  ").append(elist.get(i).toString());
+            result.append("\n  ").append(elist.get(i).toString()); //$NON-NLS-1$
         }
-        return result.append("\n)").toString();
+        return result.append("\n)").toString(); //$NON-NLS-1$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permissions.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permissions.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permissions.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permissions.java Tue Sep 26 05:46:11 2006
@@ -34,6 +34,8 @@
 import java.util.Map;
 import java.util.NoSuchElementException;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * A heterogeneous collection of permissions.
  * 
@@ -47,8 +49,8 @@
     private static final long serialVersionUID = 4858622370623524688L;
 
     private static final ObjectStreamField[] serialPersistentFields = {
-        new ObjectStreamField("perms", Hashtable.class),
-        new ObjectStreamField("allPermission", PermissionCollection.class), };
+        new ObjectStreamField("perms", Hashtable.class), //$NON-NLS-1$
+        new ObjectStreamField("allPermission", PermissionCollection.class), }; //$NON-NLS-1$
 
     // Hash to store PermissionCollection's
     private transient Map klasses = new HashMap();
@@ -68,11 +70,11 @@
 	 */
     public void add(Permission permission) {
         if (isReadOnly()) {
-            throw new SecurityException("collection is read-only");
+            throw new SecurityException(Messages.getString("security.15")); //$NON-NLS-1$
         }
 
         if (permission == null) {
-            throw new NullPointerException("invalid null permission");
+            throw new NullPointerException(Messages.getString("security.20")); //$NON-NLS-1$
         }
 
         Class klass = permission.getClass();
@@ -162,7 +164,7 @@
 
                 return next;
             }
-            throw new NoSuchElementException("no more elements");
+            throw new NoSuchElementException(Messages.getString("security.17")); //$NON-NLS-1$
         }
     }
 
@@ -180,7 +182,7 @@
     public boolean implies(Permission permission) {
         if (permission == null) {
             // RI compartible
-            throw new NullPointerException("Null permission");
+            throw new NullPointerException(Messages.getString("security.21")); //$NON-NLS-1$
         }
         if (allEnabled) {
             return true;
@@ -228,21 +230,21 @@
     private void readObject(java.io.ObjectInputStream in) throws IOException,
         ClassNotFoundException {
         ObjectInputStream.GetField fields = in.readFields();
-        Map perms = (Map)fields.get("perms", null);
+        Map perms = (Map)fields.get("perms", null); //$NON-NLS-1$
         klasses = new HashMap();
         synchronized (klasses) {
             for (Iterator iter = perms.keySet().iterator(); iter.hasNext();) {
                 Class key = (Class)iter.next();
                 PermissionCollection pc = (PermissionCollection)perms.get(key);
                 if (key != pc.elements().nextElement().getClass()) {
-                    throw new InvalidObjectException("collection is corrupted");
+                    throw new InvalidObjectException(Messages.getString("security.22")); //$NON-NLS-1$
                 }
                 klasses.put(key, pc);
             }
         }
-        allEnabled = fields.get("allPermission", null) != null;
+        allEnabled = fields.get("allPermission", null) != null; //$NON-NLS-1$
         if (allEnabled && !klasses.containsKey(AllPermission.class)) {
-            throw new InvalidObjectException("all-enabled flag is corrupted");
+            throw new InvalidObjectException(Messages.getString("security.23")); //$NON-NLS-1$
         }
     }
 
@@ -251,8 +253,8 @@
      */
     private void writeObject(java.io.ObjectOutputStream out) throws IOException {
         ObjectOutputStream.PutField fields = out.putFields();
-        fields.put("perms", new Hashtable(klasses));
-        fields.put("allPermission", allEnabled ? klasses
+        fields.put("perms", new Hashtable(klasses)); //$NON-NLS-1$
+        fields.put("allPermission", allEnabled ? klasses //$NON-NLS-1$
             .get(AllPermission.class) : null);
         out.writeFields();
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Policy.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Policy.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Policy.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Policy.java Tue Sep 26 05:46:11 2006
@@ -34,15 +34,15 @@
 public abstract class Policy {
     
     // Key to security properties, defining default policy provider.
-    private static final String POLICY_PROVIDER = "policy.provider";
+    private static final String POLICY_PROVIDER = "policy.provider"; //$NON-NLS-1$
 
     // The SecurityPermission required to set custom Policy.
     private static final SecurityPermission SET_POLICY = new SecurityPermission(
-            "setPolicy");
+            "setPolicy"); //$NON-NLS-1$
 
     // The SecurityPermission required to get current Policy.
     private static final SecurityPermission GET_POLICY = new SecurityPermission(
-            "getPolicy");
+            "getPolicy"); //$NON-NLS-1$
 
     // The policy currently in effect. 
     private static Policy activePolicy;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedActionException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedActionException.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedActionException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedActionException.java Tue Sep 26 05:46:11 2006
@@ -75,7 +75,7 @@
 	 */
     public String toString() {
         String s = getClass().getName();
-        return exception == null ? s : s + ": " + exception;
+        return exception == null ? s : s + ": " + exception; //$NON-NLS-1$
     }
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/ProtectionDomain.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/ProtectionDomain.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/ProtectionDomain.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/ProtectionDomain.java Tue Sep 26 05:46:11 2006
@@ -176,32 +176,32 @@
     public String toString() {
         //FIXME: 1.5 use StreamBuilder here
         StringBuffer buf = new StringBuffer(200);
-        buf.append("ProtectionDomain\n");
-        buf.append("CodeSource=").append(
-                codeSource == null ? "<null>" : codeSource.toString()).append(
-                "\n");
-        buf.append("ClassLoader=").append(
-                classLoader == null ? "<null>" : classLoader.toString())
-                .append("\n");
+        buf.append("ProtectionDomain\n"); //$NON-NLS-1$
+        buf.append("CodeSource=").append( //$NON-NLS-1$
+                codeSource == null ? "<null>" : codeSource.toString()).append( //$NON-NLS-1$
+                "\n"); //$NON-NLS-1$
+        buf.append("ClassLoader=").append( //$NON-NLS-1$
+                classLoader == null ? "<null>" : classLoader.toString()) //$NON-NLS-1$
+                .append("\n"); //$NON-NLS-1$
         if (principals == null || principals.length == 0) {
-            buf.append("<no principals>\n");
+            buf.append("<no principals>\n"); //$NON-NLS-1$
         } else {
-            buf.append("Principals: <\n");
+            buf.append("Principals: <\n"); //$NON-NLS-1$
             for (int i = 0; i < principals.length; i++) {
-                buf.append("\t").append(
-                        principals[i] == null ? "<null>" : principals[i]
-                                .toString()).append("\n");
+                buf.append("\t").append( //$NON-NLS-1$
+                        principals[i] == null ? "<null>" : principals[i] //$NON-NLS-1$
+                                .toString()).append("\n"); //$NON-NLS-1$
             }
-            buf.append(">");
+            buf.append(">"); //$NON-NLS-1$
         }
 
         //permissions here
-        buf.append("Permissions:\n");
+        buf.append("Permissions:\n"); //$NON-NLS-1$
         if (permissions == null) {
-            buf.append("\t\t<no static permissions>\n");
+            buf.append("\t\t<no static permissions>\n"); //$NON-NLS-1$
         } else {
-            buf.append("\t\tstatic: ").append(permissions.toString()).append(
-                    "\n");
+            buf.append("\t\tstatic: ").append(permissions.toString()).append( //$NON-NLS-1$
+                    "\n"); //$NON-NLS-1$
         }
 
         if (dynamicPerms) {
@@ -209,13 +209,13 @@
                 PermissionCollection perms;
                 perms = Policy.getAccessiblePolicy().getPermissions(this);
                 if (perms == null) {
-                    buf.append("\t\t<no dynamic permissions>\n");
+                    buf.append("\t\t<no dynamic permissions>\n"); //$NON-NLS-1$
                 } else {
-                    buf.append("\t\tdynamic: ").append(perms.toString())
-                            .append("\n");
+                    buf.append("\t\tdynamic: ").append(perms.toString()) //$NON-NLS-1$
+                            .append("\n"); //$NON-NLS-1$
                 }
             } else {
-                buf.append("\t\t<no dynamic permissions>\n");
+                buf.append("\t\t<no dynamic permissions>\n"); //$NON-NLS-1$
             }
         }
         return buf.toString();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java Tue Sep 26 05:46:11 2006
@@ -37,6 +37,7 @@
 
 import org.apache.harmony.luni.util.TwoKeyHashMap;
 import org.apache.harmony.security.fortress.Services;
+import org.apache.harmony.security.internal.nls.Messages;
 
 public abstract class Provider extends Properties {
     private static final long serialVersionUID = -4298000515446427739L;
@@ -137,13 +138,13 @@
 	 * @return a printable representation for the receiver.
 	 */
     public String toString() {
-        return name + " provider, Ver. " + version + " " + info;
+        return name + " provider, Ver. " + version + " " + info; //$NON-NLS-1$ //$NON-NLS-2$
     }
 
     public synchronized void clear() {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("clearProviderProperties." + name);
+            sm.checkSecurityAccess("clearProviderProperties." + name); //$NON-NLS-1$
         }
         super.clear();
         if (serviceTable != null) {
@@ -183,7 +184,7 @@
 
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("putProviderProperty." + name);
+            sm.checkSecurityAccess("putProviderProperty." + name); //$NON-NLS-1$
         }
         myPutAll(t);
     }
@@ -198,7 +199,7 @@
         while (it.hasNext()) {
             Map.Entry<?, ?> entry = it.next();
             key = entry.getKey();
-            if (key instanceof String && ((String) key).startsWith("Provider.")) {
+            if (key instanceof String && ((String) key).startsWith("Provider.")) { //$NON-NLS-1$
                 // Provider service type is reserved
                 continue;
             }
@@ -230,9 +231,9 @@
     public synchronized Object put(Object key, Object value) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("putProviderProperty." + name);
+            sm.checkSecurityAccess("putProviderProperty." + name); //$NON-NLS-1$
         }
-        if (key instanceof String && ((String) key).startsWith("Provider.")) {
+        if (key instanceof String && ((String) key).startsWith("Provider.")) { //$NON-NLS-1$
             // Provider service type is reserved
             return null;
         }
@@ -253,9 +254,9 @@
     public synchronized Object remove(Object key) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("removeProviderProperty." + name);
+            sm.checkSecurityAccess("removeProviderProperty." + name); //$NON-NLS-1$
         }
-        if (key instanceof String && ((String) key).startsWith("Provider.")) {
+        if (key instanceof String && ((String) key).startsWith("Provider.")) { //$NON-NLS-1$
             // Provider service type is reserved
             return null;
         }
@@ -286,20 +287,20 @@
      * @return
      */
     boolean implementsAlg(String serv, String alg, String attribute, String val) {
-        String servAlg = serv + "." + alg;
+        String servAlg = serv + "." + alg; //$NON-NLS-1$
         String prop = getPropertyIgnoreCase(servAlg);
         if (prop == null) {
-            alg = getPropertyIgnoreCase("Alg.Alias." + servAlg);
+            alg = getPropertyIgnoreCase("Alg.Alias." + servAlg); //$NON-NLS-1$
             if (alg != null) {
-                servAlg = serv + "." + alg;
-                prop = getPropertyIgnoreCase(serv + "." + alg);
+                servAlg = serv + "." + alg; //$NON-NLS-1$
+                prop = getPropertyIgnoreCase(serv + "." + alg); //$NON-NLS-1$
             }
         }
         if (prop != null) {
             if (attribute == null) {
                 return true;
             } else {
-                return checkAttribute(serv + "." + alg, attribute, val);
+                return checkAttribute(serv + "." + alg, attribute, val); //$NON-NLS-1$
             }
         }
         return false;
@@ -308,21 +309,21 @@
     // returns true if the implementation meets the constraint expressed by the
     // specified attribute name/value pair.
     private boolean checkAttribute(String servAlg, String attribute, String val) {
-        if (attribute.equalsIgnoreCase("KeySize")) {
-            if (Integer.valueOf(getProperty(servAlg + " KeySize")).compareTo(
+        if (attribute.equalsIgnoreCase("KeySize")) { //$NON-NLS-1$
+            if (Integer.valueOf(getProperty(servAlg + " KeySize")).compareTo( //$NON-NLS-1$
                     Integer.valueOf(val)) < 0) {
                 return false;
             } else {
                 return true;
             }
-        } else if (attribute.equalsIgnoreCase("ImplementedId")) {
-            if (!getProperty(servAlg + " ImplementedId").equals(val)) {
+        } else if (attribute.equalsIgnoreCase("ImplementedId")) { //$NON-NLS-1$
+            if (!getProperty(servAlg + " ImplementedId").equals(val)) { //$NON-NLS-1$
                 return false;
             } else {
                 return true;
             }
         } else { // other attributes
-            if (!getProperty(servAlg + " " + attribute).equals(val)) {
+            if (!getProperty(servAlg + " " + attribute).equals(val)) { //$NON-NLS-1$
                 return false;
             } else {
                 return true;
@@ -432,9 +433,9 @@
         }
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("putProviderProperty." + name);
+            sm.checkSecurityAccess("putProviderProperty." + name); //$NON-NLS-1$
         }
-        if ("Provider".equals(s.getType())) { // Provider service type cannot be
+        if ("Provider".equals(s.getType())) { // Provider service type cannot be //$NON-NLS-1$
                                               // added
             return;
         }
@@ -460,7 +461,7 @@
         }
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("removeProviderProperty." + name);
+            sm.checkSecurityAccess("removeProviderProperty." + name); //$NON-NLS-1$
         }
         servicesChanged();
         if (serviceTable != null) {
@@ -476,16 +477,16 @@
 
     // Add Service information to the provider's properties.
     private void serviceInfoToProperties(Provider.Service s) {
-        super.put(s.type + "." + s.algorithm, s.className);
+        super.put(s.type + "." + s.algorithm, s.className); //$NON-NLS-1$
         if (s.aliases != null) {
             for (Iterator<String> i = s.aliases.iterator(); i.hasNext();) {
-                super.put("Alg.Alias." + s.type + "." + i.next(), s.algorithm);
+                super.put("Alg.Alias." + s.type + "." + i.next(), s.algorithm); //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
         if (s.attributes != null) {
             for (Iterator<Map.Entry<String, String>> i = s.attributes.entrySet().iterator(); i.hasNext();) {
                 Map.Entry<String, String> entry = i.next();
-                super.put(s.type + "." + s.algorithm + " " + entry.getKey(),
+                super.put(s.type + "." + s.algorithm + " " + entry.getKey(), //$NON-NLS-1$ //$NON-NLS-2$
                         entry.getValue());
             }
         }
@@ -497,16 +498,16 @@
 
     // Remove Service information from the provider's properties.
     private void serviceInfoFromProperties(Provider.Service s) {
-        super.remove(s.type + "." + s.algorithm);
+        super.remove(s.type + "." + s.algorithm); //$NON-NLS-1$
         if (s.aliases != null) {
             for (Iterator<String> i = s.aliases.iterator(); i.hasNext();) {
-                super.remove("Alg.Alias." + s.type + "." + i.next());
+                super.remove("Alg.Alias." + s.type + "." + i.next()); //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
         if (s.attributes != null) {
             for (Iterator<Map.Entry<String, String>> i = s.attributes.entrySet().iterator(); i.hasNext();) {
                 Map.Entry<String, String> entry = i.next();
-                super.remove(s.type + "." + s.algorithm + " " + entry.getKey());
+                super.remove(s.type + "." + s.algorithm + " " + entry.getKey()); //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
         if (providerNumber != -1) {
@@ -521,7 +522,7 @@
             return;
         }
         String k = (String) key;
-        if (k.startsWith("Provider.")) { // Provider service type is reserved
+        if (k.startsWith("Provider.")) { // Provider service type is reserved //$NON-NLS-1$
             return;
         }
         Provider.Service s;
@@ -529,10 +530,10 @@
         String algorithm = null;
         String attribute = null;
         int i;
-        if (k.startsWith("Alg.Alias.")) { // Alg.Alias.<crypto_service>.<aliasName>=<stanbdardName>
+        if (k.startsWith("Alg.Alias.")) { // Alg.Alias.<crypto_service>.<aliasName>=<stanbdardName> //$NON-NLS-1$
             String aliasName;
             String service_alias = k.substring(10);
-            i = service_alias.indexOf(".");
+            i = service_alias.indexOf("."); //$NON-NLS-1$
             serviceName = service_alias.substring(0, i);
             aliasName = service_alias.substring(i + 1);
             if (propertyAliasTable != null) {
@@ -550,12 +551,12 @@
             }
             return;
         }
-        int j = k.indexOf(".");
+        int j = k.indexOf("."); //$NON-NLS-1$
         if (j == -1) { // unknown format
             return;
         }
 
-        i = k.indexOf(" ");
+        i = k.indexOf(" "); //$NON-NLS-1$
         if (i == -1) { // <crypto_service>.<algorithm_or_type>=<className>
             serviceName = k.substring(0, j);
             algorithm = k.substring(j + 1);
@@ -606,14 +607,14 @@
             }
             String key = (String) _key;
             String value = (String) _value;
-            if (key.startsWith("Provider")) { // Provider service type is reserved
+            if (key.startsWith("Provider")) { // Provider service type is reserved //$NON-NLS-1$
                 continue;
             }
             int i;
-            if (key.startsWith("Alg.Alias.")) { // Alg.Alias.<crypto_service>.<aliasName>=<stanbdardName>
+            if (key.startsWith("Alg.Alias.")) { // Alg.Alias.<crypto_service>.<aliasName>=<stanbdardName> //$NON-NLS-1$
                 String aliasName;
                 String service_alias = key.substring(10);
-                i = service_alias.indexOf(".");
+                i = service_alias.indexOf("."); //$NON-NLS-1$
                 serviceName = service_alias.substring(0, i);
                 aliasName = service_alias.substring(i + 1);
                 algorithm = value;
@@ -634,7 +635,7 @@
                             aliasName.toUpperCase(), s);
                 } else {
                     String className = (String) changedProperties
-                            .get(serviceName + "." + algorithm);
+                            .get(serviceName + "." + algorithm); //$NON-NLS-1$
                     if (className != null) {
                         List<String> l = new ArrayList<String>();
                         l.add(aliasName);
@@ -650,11 +651,11 @@
                 }
                 continue;
             }
-            int j = key.indexOf(".");
+            int j = key.indexOf("."); //$NON-NLS-1$
             if (j == -1) { // unknown format
                 continue;
             }
-            i = key.indexOf(" ");
+            i = key.indexOf(" "); //$NON-NLS-1$
             if (i == -1) { // <crypto_service>.<algorithm_or_type>=<className>
                 serviceName = key.substring(0, j);
                 algorithm = key.substring(j + 1);
@@ -690,7 +691,7 @@
                     s.attributes.put(attribute, value);
                 } else {
                     String className = (String) changedProperties
-                            .get(serviceName + "." + algorithm);
+                            .get(serviceName + "." + algorithm); //$NON-NLS-1$
                     if (className != null) {
                         Map<String, String> m = new HashMap<String, String>();
                         m.put(attribute, value);
@@ -718,10 +719,10 @@
     // Provider.id name, Provider.id version, Provider.id info, 
     // Provider.id className
     private void putProviderInfo() {
-        super.put("Provider.id name", name);
-        super.put("Provider.id version", versionString);
-        super.put("Provider.id info", info);
-        super.put("Provider.id className", this.getClass().getName());
+        super.put("Provider.id name", name); //$NON-NLS-1$
+        super.put("Provider.id version", versionString); //$NON-NLS-1$
+        super.put("Provider.id info", info); //$NON-NLS-1$
+        super.put("Provider.id className", this.getClass().getName()); //$NON-NLS-1$
     }
 
     // Searches for the property with the specified key in the provider
@@ -827,9 +828,9 @@
                                     implementation = Class.forName(className,
                                             true, cl);
                                 } catch (Exception e) {
-                                    return new NoSuchAlgorithmException(type
-                                            + " " + algorithm
-                                            + " implementation not found: " + e);
+                                    return new NoSuchAlgorithmException(
+                                            Messages.getString("security.11",  //$NON-NLS-1$
+                                                    new Object[]{type, algorithm, e}));
                                 }
                                 lastClassName = className;
                                 return null;
@@ -843,29 +844,29 @@
                 try {
                     return implementation.newInstance();
                 } catch (Exception e) {
-                    throw new NoSuchAlgorithmException(type + " " + algorithm
-                            + " implementation not found", e);
+                    throw new NoSuchAlgorithmException(Messages.getString("security.199", //$NON-NLS-1$
+                            type, algorithm), e);
                 }
             } else {
                 if (!supportsParameter(constructorParameter)) {
-                    throw new InvalidParameterException(type
-                            + ": service cannot use the parameter");
+                    throw new InvalidParameterException(
+                            Messages.getString("security.12", type)); //$NON-NLS-1$
                 }
 
                 Class[] parameterTypes = new Class[1];
                 Object[] initargs = { constructorParameter };
                 try {
-                    if (type.equalsIgnoreCase("CertStore")) {
+                    if (type.equalsIgnoreCase("CertStore")) { //$NON-NLS-1$
                         parameterTypes[0] = Class
-                                .forName("java.security.cert.CertStoreParameters");
+                                .forName("java.security.cert.CertStoreParameters"); //$NON-NLS-1$
                     } else {
                         parameterTypes[0] = constructorParameter.getClass();
                     }
                     return implementation.getConstructor(parameterTypes)
                             .newInstance(initargs);
                 } catch (Exception e) {
-                    throw new NoSuchAlgorithmException(type + " " + algorithm
-                            + " implementation not found", e);
+                    throw new NoSuchAlgorithmException(Messages.getString("security.199", //$NON-NLS-1$
+                            type, algorithm), e);
                 }
             }
         }
@@ -882,13 +883,13 @@
 	 * @return a printable representation for the receiver.
 	 */
         public String toString() {
-            String result = "Provider " + provider.getName() + " Service "
-                    + type + "." + algorithm + " " + className;
+            String result = "Provider " + provider.getName() + " Service " //$NON-NLS-1$ //$NON-NLS-2$
+                    + type + "." + algorithm + " " + className; //$NON-NLS-1$ //$NON-NLS-2$
             if (aliases != null) {
-                result = result + "\nAliases " + aliases.toString();
+                result = result + "\nAliases " + aliases.toString(); //$NON-NLS-1$
             }
             if (attributes != null) {
-                result = result + "\nAttributes " + attributes.toString();
+                result = result + "\nAttributes " + attributes.toString(); //$NON-NLS-1$
             }
             return result;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SecureRandom.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SecureRandom.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SecureRandom.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SecureRandom.java Tue Sep 26 05:46:11 2006
@@ -27,6 +27,7 @@
 
 import org.apache.harmony.security.fortress.Engine;
 import org.apache.harmony.security.fortress.Services;
+import org.apache.harmony.security.internal.nls.Messages;
 
 import org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl;
 
@@ -44,7 +45,7 @@
     private static final long serialVersionUID = 4940670005562187L;
     
     // The service name.
-    private static final transient String SERVICE = "SecureRandom";
+    private static final transient String SERVICE = "SecureRandom"; //$NON-NLS-1$
     
     // Used to access common engine functionality
     private static transient Engine engine = new Engine(SERVICE);
@@ -100,7 +101,7 @@
         if (service == null) {
             this.provider = null;
             this.secureRandomSpi = new SHA1PRNG_SecureRandomImpl();
-            this.algorithm = "SHA1PRNG";
+            this.algorithm = "SHA1PRNG"; //$NON-NLS-1$
         } else {
             try {
                 this.provider = service.getProvider();
@@ -132,7 +133,7 @@
         Set s;
         Provider.Service service;
         for (Iterator it1 = Services.getProvidersList().iterator(); it1.hasNext();) {
-            service = ((Provider)it1.next()).getService("SecureRandom");
+            service = ((Provider)it1.next()).getService("SecureRandom"); //$NON-NLS-1$
             if (service != null) {
                 return service;
             }
@@ -146,7 +147,7 @@
      */
     protected SecureRandom(SecureRandomSpi secureRandomSpi,
                            Provider provider) {
-        this(secureRandomSpi, provider, "unknown");
+        this(secureRandomSpi, provider, "unknown"); //$NON-NLS-1$
     }
     
     // Constructor
@@ -166,7 +167,7 @@
     public static SecureRandom getInstance(String algorithm)
                                 throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, null);
@@ -193,11 +194,11 @@
                                 throws NoSuchAlgorithmException, NoSuchProviderException {
         if ((provider == null) || (provider.length() == 0)) {
             throw new IllegalArgumentException(
-                    "Provider is null or empty string");
+                    Messages.getString("security.02")); //$NON-NLS-1$
         }
         Provider p = Security.getProvider(provider);
         if (p == null) {
-            throw new NoSuchProviderException("Provider "+ provider + " is not available"); 
+            throw new NoSuchProviderException(Messages.getString("security.03", provider));  //$NON-NLS-1$
         }
         return getInstance(algorithm, p);    
     }
@@ -209,10 +210,10 @@
     public static SecureRandom getInstance(String algorithm, Provider provider)
                                 throws NoSuchAlgorithmException {
         if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
+            throw new IllegalArgumentException(Messages.getString("security.04")); //$NON-NLS-1$
         }
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, provider, null);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Security.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Security.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Security.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Security.java Tue Sep 26 05:46:11 2006
@@ -39,6 +39,7 @@
 import org.apache.harmony.security.fortress.PolicyUtils;
 import org.apache.harmony.security.fortress.SecurityAccess;
 import org.apache.harmony.security.fortress.Services;
+import org.apache.harmony.security.internal.nls.Messages;
 
 /**
  * For access to security providers and properties.
@@ -57,9 +58,9 @@
         AccessController.doPrivileged(new java.security.PrivilegedAction() {
             public Object run() {
                 boolean loaded = false;
-                File f = new File(System.getProperty("java.home")
-                        + File.separator + "lib" + File.separator
-                        + "security" + File.separator + "java.security");
+                File f = new File(System.getProperty("java.home") //$NON-NLS-1$
+                        + File.separator + "lib" + File.separator //$NON-NLS-1$
+                        + "security" + File.separator + "java.security"); //$NON-NLS-1$ //$NON-NLS-2$
                 if (f.exists()) {
                     try {
                         FileInputStream fis = new FileInputStream(f);
@@ -73,10 +74,10 @@
                     }
                 }
 
-                if ("true".equalsIgnoreCase(secprops.getProperty("security.allowCustomePropertiesFile", "true"))) {
-                    String securityFile = System.getProperty("java.security.properties");
+                if ("true".equalsIgnoreCase(secprops.getProperty("security.allowCustomePropertiesFile", "true"))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                    String securityFile = System.getProperty("java.security.properties"); //$NON-NLS-1$
                     if (securityFile != null) {
-                        if (securityFile.startsWith("=")) { // overwrite
+                        if (securityFile.startsWith("=")) { // overwrite //$NON-NLS-1$
                             secprops = new Properties();
                             loaded = false;
                             securityFile = securityFile.substring(1);
@@ -140,7 +141,7 @@
         if (algName == null || propName == null) {
             return null;
         }
-        String prop = propName + "." + algName;
+        String prop = propName + "." + algName; //$NON-NLS-1$
         Provider[] providers = getProviders();
         for (int i = 0; i < providers.length; i++) {
             for (Enumeration e = providers[i].propertyNames(); e
@@ -166,7 +167,7 @@
         // one position for next providers; Note: The position is 1-based
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("insertProvider." + provider.getName());
+            sm.checkSecurityAccess("insertProvider." + provider.getName()); //$NON-NLS-1$
         }
         if (getProvider(provider.getName()) != null) {
             return -1;
@@ -210,7 +211,7 @@
         }
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("removeProvider." + name);
+            sm.checkSecurityAccess("removeProvider." + name); //$NON-NLS-1$
         }
         Services.removeProvider(p.getProviderNumber());
         renumProviders();
@@ -248,20 +249,20 @@
 	 */
     public static Provider[] getProviders(String filter) {
         if (filter == null) {
-            throw new NullPointerException("The filter is null");
+            throw new NullPointerException(Messages.getString("security.2A")); //$NON-NLS-1$
         }
         if (filter.length() == 0) {
             throw new InvalidParameterException(
-                    "The fillter is not in the required format");
+                    Messages.getString("security.2B")); //$NON-NLS-1$
         }
         HashMap hm = new HashMap();
-        int i = filter.indexOf(":");
+        int i = filter.indexOf(":"); //$NON-NLS-1$
         if ((i == filter.length() - 1) || (i == 0)) {
             throw new InvalidParameterException(
-                    "The fillter is not in the required format");
+                    Messages.getString("security.2B")); //$NON-NLS-1$
         }
         if (i < 1) {
-            hm.put(filter, "");
+            hm.put(filter, ""); //$NON-NLS-1$
         } else {
             hm.put(filter.substring(0, i), filter.substring(i + 1));
         }
@@ -274,7 +275,7 @@
      */
     public static synchronized Provider[] getProviders(Map<String,String> filter) {
         if (filter == null) {
-            throw new NullPointerException("The filter is null");
+            throw new NullPointerException(Messages.getString("security.2A")); //$NON-NLS-1$
         }
         if (filter.isEmpty()) {
             return null;
@@ -287,26 +288,26 @@
             String key = (String) entry.getKey();
             String val = (String) entry.getValue();
             String attribute = null;
-            int i = key.indexOf(" ");
-            int j = key.indexOf(".");
+            int i = key.indexOf(" "); //$NON-NLS-1$
+            int j = key.indexOf("."); //$NON-NLS-1$
             if (j == -1) {
                 throw new InvalidParameterException(
-                        "The fillter is not in the required format");
+                        Messages.getString("security.2B")); //$NON-NLS-1$
             }
             if (i == -1) { // <crypto_service>.<algorithm_or_type>
                 if (val.length() != 0) {
                     throw new InvalidParameterException(
-                            "The fillter is not in the required format");
+                            Messages.getString("security.2B")); //$NON-NLS-1$
                 }
             } else { // <crypto_service>.<algorithm_or_type> <attribute_name>
                 if (val.length() == 0) {
                     throw new InvalidParameterException(
-                            "The fillter is not in the required format");
+                            Messages.getString("security.2B")); //$NON-NLS-1$
                 }
                 attribute = key.substring(i + 1);
                 if (attribute.trim().length() == 0) {
                     throw new InvalidParameterException(
-                            "The fillter is not in the required format");
+                            Messages.getString("security.2B")); //$NON-NLS-1$
                 }
                 key = key.substring(0, i);
             }
@@ -314,7 +315,7 @@
             String alg = key.substring(j + 1);
             if (serv.length() == 0 || alg.length() == 0) {
                 throw new InvalidParameterException(
-                        "The fillter is not in the required format");
+                        Messages.getString("security.2B")); //$NON-NLS-1$
             }
             Provider p;
             for (int k = 0; k < result.size(); k++) {
@@ -351,11 +352,11 @@
 	 */
     public static String getProperty(String key) {
         if (key == null) {
-            throw new NullPointerException("The key is null");
+            throw new NullPointerException(Messages.getString("security.2C")); //$NON-NLS-1$
         }
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("getProperty." + key);
+            sm.checkSecurityAccess("getProperty." + key); //$NON-NLS-1$
         }
         return secprops.getProperty(key);
     }
@@ -376,7 +377,7 @@
     public static void setProperty(String key, String datnum) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("setProperty." + key);
+            sm.checkSecurityAccess("setProperty." + key); //$NON-NLS-1$
         }
         secprops.put(key, datnum);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signature.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signature.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signature.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signature.java Tue Sep 26 05:46:11 2006
@@ -29,6 +29,7 @@
 import java.util.Set;
 
 import org.apache.harmony.security.fortress.Engine;
+import org.apache.harmony.security.internal.nls.Messages;
 
 
 /**
@@ -39,7 +40,7 @@
 public abstract class Signature extends SignatureSpi {
     
     // The service name.
-    private static final String SERVICE = "Signature";
+    private static final String SERVICE = "Signature"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
@@ -89,7 +90,7 @@
     public static Signature getInstance(String algorithm)
             throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
         }
         Signature result;
         synchronized (engine) {
@@ -113,16 +114,15 @@
     public static Signature getInstance(String algorithm, String provider)
             throws NoSuchAlgorithmException, NoSuchProviderException {
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
         }
         if ((provider == null) || (provider.length() == 0)) {
             throw new IllegalArgumentException(
-                    "Provider is null or empty string");
+                    Messages.getString("security.02")); //$NON-NLS-1$
         }
         Provider p = Security.getProvider(provider);
         if (p == null) {
-            throw new NoSuchProviderException("Provider " + provider
-                    + " is not available");
+            throw new NoSuchProviderException(Messages.getString("security.03", provider)); //$NON-NLS-1$
         }
         return getSignatureInstance(algorithm, p);
     }
@@ -134,10 +134,10 @@
     public static Signature getInstance(String algorithm, Provider provider)
             throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
         }
         if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
+            throw new IllegalArgumentException(Messages.getString("security.04")); //$NON-NLS-1$
         }
         return getSignatureInstance(algorithm, provider);
     }
@@ -196,7 +196,7 @@
             boolean critical = false;
             if (ce != null && !ce.isEmpty()) {
                 for (Iterator i = ce.iterator(); i.hasNext();) {
-                    if ("2.5.29.15".equals(i.next())) { 
+                    if ("2.5.29.15".equals(i.next())) {  //$NON-NLS-1$
                         //KeyUsage OID = 2.5.29.15
                         critical = true;
                         break;
@@ -213,7 +213,7 @@
                     // KeyUsage ::= BIT STRING { digitalSignature (0), <skipped> }
                     if ((keyUsage != null) && (!keyUsage[0])) { // digitalSignature
                         throw new InvalidKeyException(
-                                "The public key in the certificate cannot be used for digital signature purposes");
+                                Messages.getString("security.26")); //$NON-NLS-1$
                     }
                 }
             }
@@ -249,7 +249,7 @@
     public final byte[] sign() throws SignatureException {
         if (state != SIGN) {
             throw new SignatureException(
-                    "Signature object is not initialized properly.");
+                    Messages.getString("security.27")); //$NON-NLS-1$
         }
         return engineSign();
     }
@@ -262,12 +262,12 @@
             throws SignatureException {
         if (state != SIGN) {
             throw new SignatureException(
-                    "Signature object is not initialized properly.");
+                    Messages.getString("security.27")); //$NON-NLS-1$
         }
         if (outbuf == null || offset < 0 || len < 0 ||
                 offset + len > outbuf.length) {
             throw new IllegalArgumentException(
-                    "Incorrect offset/len parameters");
+                    Messages.getString("security.05")); //$NON-NLS-1$
         }
         return engineSign(outbuf, offset, len);
     }
@@ -279,7 +279,7 @@
     public final boolean verify(byte[] signature) throws SignatureException {
         if (state != VERIFY) {
             throw new SignatureException(
-                    "Signature object is not initialized properly.");
+                    Messages.getString("security.27")); //$NON-NLS-1$
         }
         return engineVerify(signature);
     }
@@ -292,12 +292,12 @@
             throws SignatureException {
         if (state != VERIFY) {
             throw new SignatureException(
-                    "Signature object is not initialized properly.");
+                    Messages.getString("security.27")); //$NON-NLS-1$
         }
         if (signature == null || offset < 0 || length < 0 ||
                 offset + length > signature.length) {
             throw new IllegalArgumentException(
-                    "Incorrect offset/length parameters");
+                    Messages.getString("security.05")); //$NON-NLS-1$
         }
         return engineVerify(signature, offset, length);
     }
@@ -309,7 +309,7 @@
     public final void update(byte b) throws SignatureException {
         if (state == UNINITIALIZED) {
             throw new SignatureException(
-                    "Signature object is not initialized properly.");
+                    Messages.getString("security.27")); //$NON-NLS-1$
         }
         engineUpdate(b);
     }
@@ -321,7 +321,7 @@
     public final void update(byte[] data) throws SignatureException {
         if (state == UNINITIALIZED) {
             throw new SignatureException(
-                    "Signature object is not initialized properly.");
+                    Messages.getString("security.27")); //$NON-NLS-1$
         }
         engineUpdate(data, 0, data.length);
     }
@@ -334,12 +334,12 @@
             throws SignatureException {
         if (state == UNINITIALIZED) {
             throw new SignatureException(
-                    "Signature object is not initialized properly.");
+                    Messages.getString("security.27")); //$NON-NLS-1$
         }
         if (data == null || off < 0 || len < 0 ||
                 off + len > data.length) {
             throw new IllegalArgumentException(
-                    "Incorrect offset/len parameters");
+                    Messages.getString("security.05")); //$NON-NLS-1$
         }
         engineUpdate(data, off, len);
     }
@@ -351,7 +351,7 @@
     public final void update(ByteBuffer data) throws SignatureException {
         if (state == UNINITIALIZED) {
             throw new SignatureException(
-                    "Signature object is not initialized properly.");
+                    Messages.getString("security.27")); //$NON-NLS-1$
         }
         engineUpdate(data);
     }
@@ -361,20 +361,20 @@
      *  
      */
     public String toString() {
-        return "SIGNATURE " + algorithm + " state: " + stateToString(state);
+        return "SIGNATURE " + algorithm + " state: " + stateToString(state); //$NON-NLS-1$ //$NON-NLS-2$
     }
 
     // Convert state to string
     private String stateToString(int state) {
         switch (state) {
         case UNINITIALIZED:
-            return "UNINITIALIZED";
+            return "UNINITIALIZED"; //$NON-NLS-1$
         case SIGN:
-            return "SIGN";
+            return "SIGN"; //$NON-NLS-1$
         case VERIFY:
-            return "VERIFY";
+            return "VERIFY"; //$NON-NLS-1$
         default:
-            return "";
+            return ""; //$NON-NLS-1$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SignatureSpi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SignatureSpi.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SignatureSpi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SignatureSpi.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 import java.nio.ByteBuffer;
 import java.security.spec.AlgorithmParameterSpec;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -124,14 +126,13 @@
             return 0;
         }
         if (len < tmp.length) {
-            throw new SignatureException(
-                    "The value of len parameter is less than the actual signature length");
+            throw new SignatureException(Messages.getString("security.2D")); //$NON-NLS-1$
         }
         if (offset < 0) {
-            throw new SignatureException("Invalid negative offset");
+            throw new SignatureException(Messages.getString("security.1C")); //$NON-NLS-1$
         }
         if (offset + len > outbuf.length) {
-            throw new SignatureException("Incorrect offset or len value");
+            throw new SignatureException(Messages.getString("security.05")); //$NON-NLS-1$
         }
         System.arraycopy(tmp, 0, outbuf, offset, tmp.length);
         return tmp.length;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signer.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signer.java Tue Sep 26 05:46:11 2006
@@ -69,7 +69,7 @@
     public PrivateKey getPrivateKey() {
         SecurityManager sm = System.getSecurityManager();
         if (sm!=null) {
-            sm.checkSecurityAccess("getSignerPrivateKey");
+            sm.checkSecurityAccess("getSignerPrivateKey"); //$NON-NLS-1$
         }
         
         return privateKey;
@@ -82,7 +82,7 @@
         if ((pair==null) || (pair.getPrivate()==null) || (pair.getPublic()==null)) throw new InvalidParameterException(); 
         SecurityManager sm = System.getSecurityManager();
         if (sm!=null) {
-            sm.checkSecurityAccess("setSignerKeyPair");
+            sm.checkSecurityAccess("setSignerKeyPair"); //$NON-NLS-1$
         }
         final PublicKey pk = pair.getPublic();
         try {
@@ -104,8 +104,8 @@
      * @com.intel.drl.spec_ref 
      */    
     public String toString() {        
-        String s = "[Signer]"+getName();
-        if (getScope()!=null) s = s+"["+getScope().toString()+"]";
+        String s = "[Signer]"+getName(); //$NON-NLS-1$
+        if (getScope()!=null) s = s+"["+getScope().toString()+"]"; //$NON-NLS-1$ //$NON-NLS-2$
         return s;
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Timestamp.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Timestamp.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Timestamp.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Timestamp.java Tue Sep 26 05:46:11 2006
@@ -25,6 +25,8 @@
 import java.util.Date;
 import java.security.cert.CertPath;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref 
  */
@@ -48,10 +50,10 @@
      */
     public Timestamp(Date timestamp, CertPath signerCertPath) {
         if (timestamp == null) {
-            throw new NullPointerException("timestamp cannot be null");
+            throw new NullPointerException(Messages.getString("security.0F")); //$NON-NLS-1$
         }
         if (signerCertPath == null) {
-            throw new NullPointerException("signerCertPath cannot be null");
+            throw new NullPointerException(Messages.getString("security.10")); //$NON-NLS-1$
         }
         // Clone timestamp to prevent modifications
         this.timestamp = new Date(timestamp.getTime());
@@ -103,8 +105,8 @@
     public String toString() {
         StringBuffer buf = new StringBuffer(256);
         // Dump only the first certificate
-        buf.append("Timestamp [").append(timestamp).append(" certPath=");
-        buf.append(signerCertPath.getCertificates().get(0)).append("]");
+        buf.append("Timestamp [").append(timestamp).append(" certPath="); //$NON-NLS-1$ //$NON-NLS-2$
+        buf.append(signerCertPath.getCertificates().get(0)).append("]"); //$NON-NLS-1$
         return buf.toString();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/UnresolvedPermission.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/UnresolvedPermission.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/UnresolvedPermission.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/UnresolvedPermission.java Tue Sep 26 05:46:11 2006
@@ -37,6 +37,7 @@
 import java.util.List;
 
 import org.apache.harmony.security.fortress.PolicyUtils;
+import org.apache.harmony.security.internal.nls.Messages;
 
 /**
  * Holds permissions which are of an unknown type when a policy file is read.
@@ -56,9 +57,9 @@
     private static final long serialVersionUID = -4821973115467008846L;
 
     private static final ObjectStreamField serialPersistentFields[] = {
-        new ObjectStreamField("type", String.class),
-        new ObjectStreamField("name", String.class),
-        new ObjectStreamField("actions", String.class), };
+        new ObjectStreamField("type", String.class), //$NON-NLS-1$
+        new ObjectStreamField("name", String.class), //$NON-NLS-1$
+        new ObjectStreamField("actions", String.class), }; //$NON-NLS-1$
 
     // Target name
     private transient String targetName;
@@ -108,7 +109,7 @@
     // Check type parameter
     private final void checkType(String type) {
         if (type == null) {
-            throw new NullPointerException("type cannot be null");
+            throw new NullPointerException(Messages.getString("security.2F")); //$NON-NLS-1$
         }
 
         // type is the class name of the Permission class.
@@ -181,7 +182,7 @@
 	 * @return the actions associated with the receiver.
 	 */
     public String getActions() {
-        return "";
+        return ""; //$NON-NLS-1$
     }
 
     /** 
@@ -242,8 +243,8 @@
 	 * @return a printable representation for the receiver.
 	 */
     public String toString() {
-        return "(unresolved " + getName() + " " + targetName + " "
-            + targetActions + ")";
+        return "(unresolved " + getName() + " " + targetName + " " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+            + targetActions + ")"; //$NON-NLS-1$
     }
 
 	/**
@@ -310,9 +311,9 @@
      */
     private void writeObject(ObjectOutputStream out) throws IOException {
         ObjectOutputStream.PutField fields = out.putFields();
-        fields.put("type", getUnresolvedType());
-        fields.put("name", getUnresolvedName());
-        fields.put("actions", getUnresolvedActions());
+        fields.put("type", getUnresolvedType()); //$NON-NLS-1$
+        fields.put("name", getUnresolvedName()); //$NON-NLS-1$
+        fields.put("actions", getUnresolvedActions()); //$NON-NLS-1$
         out.writeFields();
         if (targetCerts == null) {
             out.write(0);
@@ -326,8 +327,8 @@
                     out.write(enc);
                 } catch (CertificateEncodingException cee) {
                     throw ((IOException)new NotSerializableException(
-                        "Cannot encode certificate " 
-                        + targetCerts[i]).initCause(cee));
+                        Messages.getString("security.30",  //$NON-NLS-1$
+                        targetCerts[i])).initCause(cee));
                 }
             }
         }
@@ -342,11 +343,11 @@
         ClassNotFoundException {
         checkType(getUnresolvedType());
         ObjectInputStream.GetField fields = in.readFields();
-        if (!getUnresolvedType().equals(fields.get("type", null))) {
-            throw new InvalidObjectException("target type field is corrupted");
+        if (!getUnresolvedType().equals(fields.get("type", null))) { //$NON-NLS-1$
+            throw new InvalidObjectException(Messages.getString("security.31")); //$NON-NLS-1$
         }
-        targetName = (String)fields.get("name", null);
-        targetActions = (String)fields.get("actions", null);
+        targetName = (String)fields.get("name", null); //$NON-NLS-1$
+        targetActions = (String)fields.get("actions", null); //$NON-NLS-1$
         int certNumber = in.read();
         if (certNumber != 0) {
             targetCerts = new Certificate[certNumber];
@@ -360,7 +361,7 @@
                         .generateCertificate(new ByteArrayInputStream(enc));
                 } catch (CertificateException cee) {
                     throw ((IOException)new IOException(
-                        "Error decoding certificate").initCause(cee));
+                        Messages.getString("security.32")).initCause(cee)); //$NON-NLS-1$
                 }
             }
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/UnresolvedPermissionCollection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/UnresolvedPermissionCollection.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/UnresolvedPermissionCollection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/UnresolvedPermissionCollection.java Tue Sep 26 05:46:11 2006
@@ -37,6 +37,8 @@
 import java.util.Map;
 import java.util.Vector;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * Specific PermissionCollection for storing UnresolvedPermissions. Contained
  * elements are grouped by their target type.
@@ -50,7 +52,7 @@
     private static final long serialVersionUID = -7176153071733132400L;
 
     private static final ObjectStreamField[] serialPersistentFields = { 
-        new ObjectStreamField("permissions", Hashtable.class), };
+        new ObjectStreamField("permissions", Hashtable.class), }; //$NON-NLS-1$
 
     // elements of the collection.
     private transient Map klasses = new HashMap();
@@ -62,12 +64,12 @@
      */
     public void add(Permission permission) {
         if (isReadOnly()) {
-            throw new SecurityException("collection is read-only");
+            throw new SecurityException(Messages.getString("security.15")); //$NON-NLS-1$
         }
         if (permission == null
             || permission.getClass() != UnresolvedPermission.class) {
-            throw new IllegalArgumentException("invalid permission: "
-                + permission);
+            throw new IllegalArgumentException(Messages.getString("security.16", //$NON-NLS-1$
+                permission));
         }
         synchronized (klasses) {
             String klass = permission.getName();
@@ -163,7 +165,7 @@
             permissions.put(key, new Vector(((Collection)klasses.get(key))));
         }
         ObjectOutputStream.PutField fields = out.putFields();
-        fields.put("permissions", permissions);
+        fields.put("permissions", permissions); //$NON-NLS-1$
         out.writeFields();
     }
 
@@ -175,7 +177,7 @@
     private void readObject(java.io.ObjectInputStream in) throws IOException,
         ClassNotFoundException {
         ObjectInputStream.GetField fields = in.readFields();
-        Map permissions = (Map)fields.get("permissions", null);
+        Map permissions = (Map)fields.get("permissions", null); //$NON-NLS-1$
         klasses = new HashMap();
         synchronized (klasses) {
             for (Iterator iter = permissions.keySet().iterator(); iter
@@ -187,7 +189,7 @@
                         .next();
                     if (!element.getName().equals(key)) {
                         throw new InvalidObjectException(
-                            "collection is corrupted");
+                            Messages.getString("security.22")); //$NON-NLS-1$
                     }
                 }
                 klasses.put(key, new HashSet(values));

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPath.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPath.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPath.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPath.java Tue Sep 26 05:46:11 2006
@@ -29,6 +29,8 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * An immutable certificate path that can be validated. All certificates in the
  * path are of the same type (i.e., X509).
@@ -113,18 +115,18 @@
 	 */
     public String toString() {
         StringBuffer sb = new StringBuffer(getType());
-        sb.append(" Cert Path, len=");
+        sb.append(" Cert Path, len="); //$NON-NLS-1$
         sb.append(getCertificates().size());
-        sb.append(": [\n");
+        sb.append(": [\n"); //$NON-NLS-1$
         int n=1;
         for (Iterator i=getCertificates().iterator();
                       i.hasNext(); n++) {
-            sb.append("---------------certificate ");
+            sb.append("---------------certificate "); //$NON-NLS-1$
             sb.append(n);
-            sb.append("---------------\n");
+            sb.append("---------------\n"); //$NON-NLS-1$
             sb.append(((Certificate)i.next()).toString());
         }
-        sb.append("\n]");
+        sb.append("\n]"); //$NON-NLS-1$
         return sb.toString();
     }
 
@@ -175,7 +177,7 @@
             return new CertPathRep(getType(), getEncoded());
         } catch (CertificateEncodingException e) {
             throw new NotSerializableException (
-                    "Could not create serialization object: " + e);
+                    Messages.getString("security.66", e)); //$NON-NLS-1$
         }
     }
 
@@ -195,8 +197,8 @@
         // Force default serialization to use writeUnshared/readUnshared
         // for cert path data
         private static final ObjectStreamField[] serialPersistentFields = {
-             new ObjectStreamField("type", String.class),
-             new ObjectStreamField("data", byte[].class, true)
+             new ObjectStreamField("type", String.class), //$NON-NLS-1$
+             new ObjectStreamField("data", byte[].class, true) //$NON-NLS-1$
         };
 
         /**
@@ -216,7 +218,7 @@
                 return cf.generateCertPath(new ByteArrayInputStream(data));
             } catch (Throwable t) {
                 throw new NotSerializableException(
-                        "Could not resolve cert path: " + t);
+                        Messages.getString("security.67", t)); //$NON-NLS-1$
             }
         }
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathBuilder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathBuilder.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathBuilder.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathBuilder.java Tue Sep 26 05:46:11 2006
@@ -29,6 +29,7 @@
 import java.security.Security;
 
 import org.apache.harmony.security.fortress.Engine;
+import org.apache.harmony.security.internal.nls.Messages;
 
 
 /**
@@ -39,17 +40,17 @@
 public class CertPathBuilder {
 
     // Store CertPathBuilder service name
-    private static final String SERVICE = "CertPathBuilder";
+    private static final String SERVICE = "CertPathBuilder"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
 
     // Store default property name
-    private static final String PROPERTYNAME = "certpathbuild.type";
+    private static final String PROPERTYNAME = "certpathbuild.type"; //$NON-NLS-1$
 
     // Default value of CertPathBuilder type. It returns if certpathbuild.type
     // property is not defined in java.security file
-    private static final String DEFAULTPROPERTY = "PKIX";
+    private static final String DEFAULTPROPERTY = "PKIX"; //$NON-NLS-1$
 
     // Store used provider
     private final Provider provider;
@@ -93,7 +94,7 @@
     public static CertPathBuilder getInstance(String algorithm)
             throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("algorithm is null");
+            throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, null);
@@ -114,7 +115,7 @@
     public static CertPathBuilder getInstance(String algorithm, String provider)
             throws NoSuchAlgorithmException, NoSuchProviderException {
         if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException("Provider is null or empty");
+            throw new IllegalArgumentException(Messages.getString("security.02")); //$NON-NLS-1$
         }
         Provider impProvider = Security.getProvider(provider);
         if (impProvider == null) {
@@ -133,10 +134,10 @@
     public static CertPathBuilder getInstance(String algorithm,
             Provider provider) throws NoSuchAlgorithmException {
         if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
+            throw new IllegalArgumentException(Messages.getString("security.04")); //$NON-NLS-1$
         }
         if (algorithm == null) {
-            throw new NullPointerException("algorithm is null");
+            throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, provider, null);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathValidator.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathValidator.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathValidator.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathValidator.java Tue Sep 26 05:46:11 2006
@@ -29,6 +29,7 @@
 import java.security.Security;
 
 import org.apache.harmony.security.fortress.Engine;
+import org.apache.harmony.security.internal.nls.Messages;
 
 
 /**
@@ -38,17 +39,17 @@
 
 public class CertPathValidator {
     // Store CertPathValidator implementation service name
-    private static final String SERVICE = "CertPathValidator";
+    private static final String SERVICE = "CertPathValidator"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
 
     // Store default property name
-    private static final String PROPERTYNAME = "certpathvalidator.type";
+    private static final String PROPERTYNAME = "certpathvalidator.type"; //$NON-NLS-1$
 
     // Default value of CertPathBuilder type. It returns if certpathbuild.type
     // property is not defined in java.security file
-    private static final String DEFAULTPROPERTY = "PKIX";
+    private static final String DEFAULTPROPERTY = "PKIX"; //$NON-NLS-1$
 
     // Store used provider
     private final Provider provider;
@@ -94,7 +95,7 @@
     public static CertPathValidator getInstance(String algorithm)
             throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("algorithm is null");
+            throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, null);
@@ -112,7 +113,7 @@
             String provider) throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException("Provider is null or empty");
+            throw new IllegalArgumentException(Messages.getString("security.02")); //$NON-NLS-1$
         }
         Provider impProvider = Security.getProvider(provider);
         if (impProvider == null) {
@@ -129,10 +130,10 @@
     public static CertPathValidator getInstance(String algorithm,
             Provider provider) throws NoSuchAlgorithmException {
         if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
+            throw new IllegalArgumentException(Messages.getString("security.04")); //$NON-NLS-1$
         }
         if (algorithm == null) {
-            throw new NullPointerException("algorithm is null");
+            throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, provider, null);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathValidatorException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathValidatorException.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathValidatorException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathValidatorException.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 
 import java.security.GeneralSecurityException;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -58,11 +60,11 @@
         // check certPath and index parameters
         if ((certPath == null) && (index != -1)) {
             throw new IllegalArgumentException(
-                    "Index should be -1 when CertPath is null");
+                    Messages.getString("security.53")); //$NON-NLS-1$
         }
         if ((certPath != null)
                 && ((index < -1) || (index >= certPath.getCertificates().size()))) {
-            throw new IndexOutOfBoundsException("Invalid index");
+            throw new IndexOutOfBoundsException(Messages.getString("security.54")); //$NON-NLS-1$
         }
         this.certPath = certPath;
         this.index = index;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertStore.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertStore.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertStore.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertStore.java Tue Sep 26 05:46:11 2006
@@ -30,6 +30,7 @@
 import java.util.Collection;
 
 import org.apache.harmony.security.fortress.Engine;
+import org.apache.harmony.security.internal.nls.Messages;
 
 
 /**
@@ -40,17 +41,17 @@
 public class CertStore {
 
     // Store spi implementation service name
-    private static final String SERVICE = "CertStore";
+    private static final String SERVICE = "CertStore"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
 
     // Store default property name
-    private static final String PROPERTYNAME = "certstore.type";
+    private static final String PROPERTYNAME = "certstore.type"; //$NON-NLS-1$
 
     // Default value of CertStore type. It returns if certpathbuild.type
     // property is not defined in java.security file
-    private static final String DEFAULTPROPERTY = "LDAP";
+    private static final String DEFAULTPROPERTY = "LDAP"; //$NON-NLS-1$
 
     // Store used provider
     private final Provider provider;
@@ -84,7 +85,7 @@
     public static CertStore getInstance(String type, CertStoreParameters params)
             throws InvalidAlgorithmParameterException, NoSuchAlgorithmException {
         if (type == null) {
-            throw new NullPointerException("type is null");
+            throw new NullPointerException(Messages.getString("security.07")); //$NON-NLS-1$
         }
         try {
             synchronized (engine) {
@@ -115,7 +116,7 @@
             throws InvalidAlgorithmParameterException,
             NoSuchAlgorithmException, NoSuchProviderException {
         if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException("Provider is null or empty");
+            throw new IllegalArgumentException(Messages.getString("security.02")); //$NON-NLS-1$
         }
         Provider impProvider = Security.getProvider(provider);
         if (impProvider == null) {
@@ -134,10 +135,10 @@
             CertStoreParameters params, Provider provider)
             throws NoSuchAlgorithmException, InvalidAlgorithmParameterException {
         if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
+            throw new IllegalArgumentException(Messages.getString("security.04")); //$NON-NLS-1$
         }
         if (type == null) {
-            throw new NullPointerException("type is null");
+            throw new NullPointerException(Messages.getString("security.07")); //$NON-NLS-1$
         }
         try {
             synchronized (engine) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/Certificate.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/Certificate.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/Certificate.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/Certificate.java Tue Sep 26 05:46:11 2006
@@ -33,6 +33,8 @@
 import java.security.SignatureException;
 import java.util.Arrays;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * 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,
@@ -197,7 +199,7 @@
             return new CertificateRep(getType(), getEncoded());
         } catch (CertificateEncodingException e) {  
             throw new NotSerializableException (
-                    "Could not create serialization object: " + e);
+                    Messages.getString("security.66", e)); //$NON-NLS-1$
         }
     }
 
@@ -218,8 +220,8 @@
         // Force default serialization to use writeUnshared/readUnshared
         // for the certificate data
         private static final ObjectStreamField[] serialPersistentFields = {
-             new ObjectStreamField("type", String.class),
-             new ObjectStreamField("data", byte[].class, true)
+             new ObjectStreamField("type", String.class), //$NON-NLS-1$
+             new ObjectStreamField("data", byte[].class, true) //$NON-NLS-1$
         };
 
         /**
@@ -239,7 +241,7 @@
                 return cf.generateCertificate(new ByteArrayInputStream(data));
             } catch (Throwable t) {
                 throw new NotSerializableException(
-                        "Could not resolve certificate: " + t);
+                        Messages.getString("security.68", t)); //$NON-NLS-1$
             }
         }
     }



Mime
View raw message