harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r450032 [3/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/cert/CertificateFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertificateFactory.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertificateFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertificateFactory.java Tue Sep 26 05:46:11 2006
@@ -31,6 +31,7 @@
 import java.util.List;
 
 import org.apache.harmony.security.fortress.Engine;
+import org.apache.harmony.security.internal.nls.Messages;
 
 
 /**
@@ -40,7 +41,7 @@
 public class CertificateFactory {
 
     // Store CertificateFactory service name
-    private static final String SERVICE = "CertificateFactory";
+    private static final String SERVICE = "CertificateFactory"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
@@ -82,7 +83,7 @@
     public static final CertificateFactory getInstance(String type)
             throws CertificateException {
         if (type == null) {
-            throw new NullPointerException("type is null");
+            throw new NullPointerException(Messages.getString("security.07")); //$NON-NLS-1$
         }
         try {
             synchronized (engine) {
@@ -105,7 +106,7 @@
             String provider) throws CertificateException,
             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 @@
     public static final CertificateFactory getInstance(String type,
             Provider provider) throws CertificateException {
         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) {
@@ -212,7 +213,7 @@
             throws CertificateException {
         Iterator it = getCertPathEncodings();
         if (!it.hasNext()) {
-            throw new CertificateException("There are no CertPath encodings");
+            throw new CertificateException(Messages.getString("security.74")); //$NON-NLS-1$
         }
         return spiImpl.engineGenerateCertPath(inStream, (String) it.next());
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertificateFactorySpi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertificateFactorySpi.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertificateFactorySpi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertificateFactorySpi.java Tue Sep 26 05:46:11 2006
@@ -26,6 +26,8 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * This class is a Service Provider Interface (therefore the Spi suffix) for
  * certificate factories to be supplied by providers.
@@ -113,7 +115,7 @@
     public CertPath engineGenerateCertPath(InputStream inStream)
             throws CertificateException {
         throw new UnsupportedOperationException(
-                "Method engineGenerateCertPath(InputStream inStream) is not supported");
+                Messages.getString("security.70")); //$NON-NLS-1$
     }
 
     /**
@@ -137,7 +139,7 @@
     public CertPath engineGenerateCertPath(InputStream inStream, String encoding)
             throws CertificateException {
         throw new UnsupportedOperationException(
-                "Method engineGenerateCertPath(InputStream inStream, String encoding) is not supported");
+                Messages.getString("security.71")); //$NON-NLS-1$
     }
 
     /**
@@ -158,7 +160,7 @@
     public CertPath engineGenerateCertPath(List<? extends Certificate>  certificates) 
             throws CertificateException {
         throw new UnsupportedOperationException(
-                "Method engineGenerateCertPath(List certificates) is not supported");
+                Messages.getString("security.72")); //$NON-NLS-1$
     }
 
     /**
@@ -169,6 +171,6 @@
      */
     public Iterator<String> engineGetCertPathEncodings() {
         throw new UnsupportedOperationException(
-                "Method engineGetCertPathEncodings() is not supported");
+                Messages.getString("security.73")); //$NON-NLS-1$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CollectionCertStoreParameters.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CollectionCertStoreParameters.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CollectionCertStoreParameters.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CollectionCertStoreParameters.java Tue Sep 26 05:46:11 2006
@@ -73,9 +73,9 @@
      */
     public String toString() {
         StringBuffer sb =
-            new StringBuffer("CollectionCertStoreParameters: [\ncollection: ");
+            new StringBuffer("CollectionCertStoreParameters: [\ncollection: "); //$NON-NLS-1$
         sb.append(getCollection().toString());
-        sb.append("\n]");
+        sb.append("\n]"); //$NON-NLS-1$
         return sb.toString();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/LDAPCertStoreParameters.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/LDAPCertStoreParameters.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/LDAPCertStoreParameters.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/LDAPCertStoreParameters.java Tue Sep 26 05:46:11 2006
@@ -27,7 +27,7 @@
  */
 public class LDAPCertStoreParameters implements CertStoreParameters {
     // Default LDAP server name
-    private static final String DEFAULT_LDAP_SERVER_NAME = "localhost";
+    private static final String DEFAULT_LDAP_SERVER_NAME = "localhost"; //$NON-NLS-1$
     // Default LDAP server port number 
     private static final int DEFAULT_LDAP_PORT  = 389;
 
@@ -92,11 +92,11 @@
      */
     public String toString() {
         StringBuffer sb =
-            new StringBuffer("LDAPCertStoreParameters: [\n serverName: ");
+            new StringBuffer("LDAPCertStoreParameters: [\n serverName: "); //$NON-NLS-1$
         sb.append(getServerName());
-        sb.append("\n port: ");
+        sb.append("\n port: "); //$NON-NLS-1$
         sb.append(getPort());
-        sb.append("\n]");
+        sb.append("\n]"); //$NON-NLS-1$
         return sb.toString();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXBuilderParameters.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXBuilderParameters.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXBuilderParameters.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXBuilderParameters.java Tue Sep 26 05:46:11 2006
@@ -27,6 +27,8 @@
 import java.security.KeyStoreException;
 import java.util.Set;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -69,7 +71,7 @@
     public void setMaxPathLength(int maxPathLength) {
         if (maxPathLength < -1) {
             throw new InvalidParameterException(
-                    "the maxPathLength parameter is less than -1");
+                    Messages.getString("security.5B")); //$NON-NLS-1$
         }
         this.maxPathLength = maxPathLength;
     }
@@ -78,11 +80,11 @@
      * @com.intel.drl.spec_ref
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer("[\n");
+        StringBuffer sb = new StringBuffer("[\n"); //$NON-NLS-1$
         sb.append(super.toString());
-        sb.append(" Max Path Length: ");
+        sb.append(" Max Path Length: "); //$NON-NLS-1$
         sb.append(maxPathLength);
-        sb.append("\n]");
+        sb.append("\n]"); //$NON-NLS-1$
         return sb.toString();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXCertPathBuilderResult.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXCertPathBuilderResult.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXCertPathBuilderResult.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXCertPathBuilderResult.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 
 import java.security.PublicKey;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -40,7 +42,7 @@
         super(trustAnchor, policyTree, subjectPublicKey);
         this.certPath = certPath;
         if (this.certPath == null) {
-            throw new NullPointerException("the certPath parameter is null");
+            throw new NullPointerException(Messages.getString("security.55")); //$NON-NLS-1$
         }
     }
 
@@ -56,9 +58,9 @@
      */
     public String toString() {
         StringBuffer sb = new StringBuffer(super.toString());
-        sb.append("\n Certification Path: ");
+        sb.append("\n Certification Path: "); //$NON-NLS-1$
         sb.append(certPath.toString());
-        sb.append("\n]");
+        sb.append("\n]"); //$NON-NLS-1$
         return sb.toString();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXCertPathValidatorResult.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXCertPathValidatorResult.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXCertPathValidatorResult.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXCertPathValidatorResult.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 
 import java.security.PublicKey;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -45,11 +47,11 @@
         this.policyTree = policyTree;
         this.subjectPublicKey = subjectPublicKey;
         if (this.trustAnchor == null) {
-            throw new NullPointerException("the trustAnchor parameter is null");
+            throw new NullPointerException(Messages.getString("security.64")); //$NON-NLS-1$
         }
         if (this.subjectPublicKey == null) {
             throw new NullPointerException(
-                    "the subjectPublicKey parameter is null");
+                    Messages.getString("security.65")); //$NON-NLS-1$
         }
     }
 
@@ -87,14 +89,14 @@
      */
     public String toString() {
         StringBuffer sb = new StringBuffer(super.toString());
-        sb.append(": [\n Trust Anchor: ");
+        sb.append(": [\n Trust Anchor: "); //$NON-NLS-1$
         sb.append(trustAnchor.toString());
-        sb.append("\n Policy Tree: ");
-        sb.append(policyTree == null ? "no valid policy tree\n"
+        sb.append("\n Policy Tree: "); //$NON-NLS-1$
+        sb.append(policyTree == null ? "no valid policy tree\n" //$NON-NLS-1$
                                      : policyTree.toString());
-        sb.append("\n Subject Public Key: ");
+        sb.append("\n Subject Public Key: "); //$NON-NLS-1$
         sb.append(subjectPublicKey.toString());
-        sb.append("\n]");
+        sb.append("\n]"); //$NON-NLS-1$
         return sb.toString();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXParameters.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXParameters.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXParameters.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXParameters.java Tue Sep 26 05:46:11 2006
@@ -33,6 +33,8 @@
 import java.util.List;
 import java.util.Set;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -72,8 +74,7 @@
     public PKIXParameters(Set<TrustAnchor> trustAnchors)
         throws InvalidAlgorithmParameterException {
         if (trustAnchors == null) {
-            throw new NullPointerException(
-                    "the trustAnchors parameter is null");
+            throw new NullPointerException(Messages.getString("security.6F")); //$NON-NLS-1$
         }
         checkTrustAnchors(trustAnchors);
         this.trustAnchors = new HashSet<TrustAnchor>(trustAnchors);
@@ -86,13 +87,13 @@
         throws KeyStoreException,
                InvalidAlgorithmParameterException {
         if (keyStore == null) {
-            throw new NullPointerException("the keyStore parameter is null");
+            throw new NullPointerException(Messages.getString("security.41")); //$NON-NLS-1$
         }
         // Will throw KeyStoreException if
         // keyStore has not been initialized (loaded)
         if (keyStore.size() == 0) {
             throw new InvalidAlgorithmParameterException(
-                    "the keystore is empty");
+                    Messages.getString("security.6A")); //$NON-NLS-1$
         }
         // keyStore is not null and loaded
         trustAnchors = new HashSet<TrustAnchor>();
@@ -126,7 +127,7 @@
         throws InvalidAlgorithmParameterException {
         if (trustAnchors == null) {
             throw new NullPointerException(
-                    "the trustAnchors parameter is null");
+                    Messages.getString("security.6F")); //$NON-NLS-1$
         }
         checkTrustAnchors(trustAnchors);
         // make shallow copy
@@ -245,8 +246,7 @@
         // check that all elements are CertStore
         for (Iterator i = this.certStores.iterator(); i.hasNext();) {
             if (!(i.next() instanceof CertStore)) {
-                throw new ClassCastException(
-              "all list elements must be of type java.security.cert.CertStore");
+                throw new ClassCastException(Messages.getString("security.6B")); //$NON-NLS-1$
             }
         }
     }
@@ -332,8 +332,7 @@
         // check that all elements are String
         for (Iterator i = this.initialPolicies.iterator(); i.hasNext();) {
             if (!(i.next() instanceof String)) {
-                throw new ClassCastException(
-                        "all set elements must be of type java.lang.String");
+                throw new ClassCastException(Messages.getString("security.6C")); //$NON-NLS-1$
             }
         }
     }
@@ -435,34 +434,34 @@
      */
     public String toString() {
         StringBuffer sb =
-            new StringBuffer("[\n Trust Anchors: ");
+            new StringBuffer("[\n Trust Anchors: "); //$NON-NLS-1$
         sb.append(trustAnchors);
-        sb.append("\n Revocation Enabled: ");
+        sb.append("\n Revocation Enabled: "); //$NON-NLS-1$
         sb.append(revocationEnabled);
-        sb.append("\n Explicit Policy Required: ");
+        sb.append("\n Explicit Policy Required: "); //$NON-NLS-1$
         sb.append(explicitPolicyRequired);
-        sb.append("\n Policy Mapping Inhibited: ");
+        sb.append("\n Policy Mapping Inhibited: "); //$NON-NLS-1$
         sb.append(policyMappingInhibited);
-        sb.append("\n Any Policy Inhibited: ");
+        sb.append("\n Any Policy Inhibited: "); //$NON-NLS-1$
         sb.append(anyPolicyInhibited);
-        sb.append("\n Policy Qualifiers Rejected: ");
+        sb.append("\n Policy Qualifiers Rejected: "); //$NON-NLS-1$
         sb.append(policyQualifiersRejected);
-        sb.append("\n Initial Policy OIDs: ");
+        sb.append("\n Initial Policy OIDs: "); //$NON-NLS-1$
         sb.append((initialPolicies == null || initialPolicies.isEmpty())
-                ? "any" : initialPolicies.toString());
-        sb.append("\n Cert Stores: ");
+                ? "any" : initialPolicies.toString()); //$NON-NLS-1$
+        sb.append("\n Cert Stores: "); //$NON-NLS-1$
         sb.append((certStores==null||certStores.isEmpty())?
-                "no":certStores.toString());
-        sb.append("\n Validity Date: ");
+                "no":certStores.toString()); //$NON-NLS-1$
+        sb.append("\n Validity Date: "); //$NON-NLS-1$
         sb.append(date);
-        sb.append("\n Cert Path Checkers: ");
+        sb.append("\n Cert Path Checkers: "); //$NON-NLS-1$
         sb.append((certPathCheckers==null||certPathCheckers.isEmpty())?
-                "no":certPathCheckers.toString());
-        sb.append("\n Signature Provider: ");
+                "no":certPathCheckers.toString()); //$NON-NLS-1$
+        sb.append("\n Signature Provider: "); //$NON-NLS-1$
         sb.append(sigProvider);
-        sb.append("\n Target Certificate Constraints: ");
+        sb.append("\n Target Certificate Constraints: "); //$NON-NLS-1$
         sb.append(targetCertConstraints);
-        sb.append("\n]");
+        sb.append("\n]"); //$NON-NLS-1$
         return sb.toString();
     }
 
@@ -479,12 +478,12 @@
         throws InvalidAlgorithmParameterException {
         if (trustAnchors.isEmpty()) {
             throw new InvalidAlgorithmParameterException(
-                    "the trust anchors set is empty");
+                    Messages.getString("security.6D")); //$NON-NLS-1$
         }
         for (Iterator i = trustAnchors.iterator(); i.hasNext();) {
             if (!(i.next() instanceof TrustAnchor)) {
                 throw new ClassCastException(
-             "all set elements must be of type java.security.cert.TrustAnchor");
+             Messages.getString("security.6E")); //$NON-NLS-1$
             }
         }
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PolicyQualifierInfo.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PolicyQualifierInfo.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PolicyQualifierInfo.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PolicyQualifierInfo.java Tue Sep 26 05:46:11 2006
@@ -24,6 +24,7 @@
 import java.io.IOException;
 
 import org.apache.harmony.security.asn1.ObjectIdentifier;
+import org.apache.harmony.security.internal.nls.Messages;
 import org.apache.harmony.security.utils.Array;
 
 
@@ -46,10 +47,10 @@
      */
     public PolicyQualifierInfo(byte[] encoded) throws IOException {
         if (encoded == null) {
-            throw new IOException("the encoded parameter is null");
+            throw new IOException(Messages.getString("security.0A")); //$NON-NLS-1$
         }
         if (encoded.length == 0) {
-            throw new IOException("the encoded length is 0");
+            throw new IOException(Messages.getString("security.69")); //$NON-NLS-1$
         }
         this.encoded = new byte[encoded.length];
         System.arraycopy(encoded, 0, this.encoded, 0, this.encoded.length);
@@ -94,11 +95,11 @@
      */
     public String toString() {
         StringBuffer sb =
-            new StringBuffer("PolicyQualifierInfo: [\npolicyQualifierId: ");
+            new StringBuffer("PolicyQualifierInfo: [\npolicyQualifierId: "); //$NON-NLS-1$
         sb.append(policyQualifierId);
-        sb.append("\npolicyQualifier: \n");
-        sb.append(Array.toString(policyQualifier, " "));
-        sb.append("]");
+        sb.append("\npolicyQualifier: \n"); //$NON-NLS-1$
+        sb.append(Array.toString(policyQualifier, " ")); //$NON-NLS-1$
+        sb.append("]"); //$NON-NLS-1$
         return sb.toString();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/TrustAnchor.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/TrustAnchor.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/TrustAnchor.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/TrustAnchor.java Tue Sep 26 05:46:11 2006
@@ -26,6 +26,7 @@
 
 import javax.security.auth.x500.X500Principal;
 
+import org.apache.harmony.security.internal.nls.Messages;
 import org.apache.harmony.security.utils.Array;
 import org.apache.harmony.security.x509.NameConstraints;
 
@@ -52,7 +53,7 @@
      */
     public TrustAnchor(X509Certificate trustedCert, byte[] nameConstraints) {
         if (trustedCert == null) {
-            throw new NullPointerException("the trustedCert parameter is null");
+            throw new NullPointerException(Messages.getString("security.5C")); //$NON-NLS-1$
         }
         this.trustedCert = trustedCert;
         // copy nameConstraints if not null
@@ -75,11 +76,11 @@
     public TrustAnchor(String caName, PublicKey caPublicKey,
             byte[] nameConstraints) {
         if (caName == null) {
-            throw new NullPointerException("the caName parameter is null");
+            throw new NullPointerException(Messages.getString("security.5D")); //$NON-NLS-1$
         }
         this.caName = caName;
         if (caPublicKey == null) {
-            throw new NullPointerException("the caPublicKey parameter is null");
+            throw new NullPointerException(Messages.getString("security.5E")); //$NON-NLS-1$
         }
         this.caPublicKey = caPublicKey;
         // copy nameConstraints if not null
@@ -97,7 +98,7 @@
         // X500Principal checks caName validity
         if (caName.length() == 0) {
             throw new IllegalArgumentException(
-                    "the caName parameter is empty string");
+                    Messages.getString("security.5F")); //$NON-NLS-1$
         }
         this.caPrincipal = new X500Principal(this.caName);
     }
@@ -108,11 +109,11 @@
     public TrustAnchor(X500Principal caPrincipal,
             PublicKey caPublicKey, byte[] nameConstraints) {
         if (caPrincipal == null) {
-            throw new NullPointerException("the caPrincipal parameter is null");
+            throw new NullPointerException(Messages.getString("security.60")); //$NON-NLS-1$
         }
         this.caPrincipal = caPrincipal;
         if (caPublicKey == null) {
-            throw new NullPointerException("the caPublicKey parameter is null");
+            throw new NullPointerException(Messages.getString("security.5E")); //$NON-NLS-1$
         }
         this.caPublicKey = caPublicKey;
         // copy nameConstraints if not null
@@ -174,28 +175,28 @@
      * @com.intel.drl.spec_ref
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer("TrustAnchor: [\n");
+        StringBuffer sb = new StringBuffer("TrustAnchor: [\n"); //$NON-NLS-1$
         if (trustedCert != null) {
-            sb.append("Trusted CA certificate: ");
+            sb.append("Trusted CA certificate: "); //$NON-NLS-1$
             sb.append(trustedCert);
-            sb.append("\n");
+            sb.append("\n"); //$NON-NLS-1$
         }
         if (caPrincipal != null) {
-            sb.append("Trusted CA Name: ");
+            sb.append("Trusted CA Name: "); //$NON-NLS-1$
             sb.append(caPrincipal);
-            sb.append("\n");
+            sb.append("\n"); //$NON-NLS-1$
         }
         if (caPublicKey != null) {
-            sb.append("Trusted CA Public Key: ");
+            sb.append("Trusted CA Public Key: "); //$NON-NLS-1$
             sb.append(caPublicKey);
-            sb.append("\n");
+            sb.append("\n"); //$NON-NLS-1$
         }
         // FIXME if needed:
         if (nameConstraints != null) {
-            sb.append("Name Constraints:\n");
-            sb.append(Array.toString(nameConstraints, "    "));
+            sb.append("Name Constraints:\n"); //$NON-NLS-1$
+            sb.append(Array.toString(nameConstraints, "    ")); //$NON-NLS-1$
         }
-        sb.append("\n]");
+        sb.append("\n]"); //$NON-NLS-1$
         return sb.toString();
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CRL.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CRL.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CRL.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CRL.java Tue Sep 26 05:46:11 2006
@@ -38,6 +38,8 @@
 import java.util.Set;
 import javax.security.auth.x500.X500Principal;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -47,7 +49,7 @@
      * @com.intel.drl.spec_ref
      */
     protected X509CRL() {
-        super("X.509");
+        super("X.509"); //$NON-NLS-1$
     }
 
     /**
@@ -124,7 +126,7 @@
             // TODO if there is no X.509 certificate provider installed
             // should we try to access Harmony X509CRLImpl via classForName?
             CertificateFactory factory = CertificateFactory
-                    .getInstance("X.509");
+                    .getInstance("X.509"); //$NON-NLS-1$
 
             X509CRL crl = (X509CRL) factory
                     .generateCRL(new ByteArrayInputStream(getEncoded()));
@@ -132,7 +134,7 @@
             return crl.getIssuerX500Principal();
 
         } catch (Exception e) {
-            throw new RuntimeException("Failed to get X500Principal issuer", e);
+            throw new RuntimeException(Messages.getString("security.59"), e); //$NON-NLS-1$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CRLSelector.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CRLSelector.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CRLSelector.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CRLSelector.java Tue Sep 26 05:46:11 2006
@@ -31,6 +31,7 @@
 
 import org.apache.harmony.security.asn1.ASN1Integer;
 import org.apache.harmony.security.asn1.ASN1OctetString;
+import org.apache.harmony.security.internal.nls.Messages;
 import org.apache.harmony.security.x501.Name;
 
 /**
@@ -98,7 +99,7 @@
                             X500Principal.CANONICAL));
             } else {
                 throw new IOException(
-                        "The name is not a String or byte array");
+                        Messages.getString("security.62")); //$NON-NLS-1$
             }
         }
     }
@@ -108,7 +109,7 @@
      */
     public void addIssuer(X500Principal issuer) {
         if (issuer == null) {
-            throw new NullPointerException("issuer");
+            throw new NullPointerException(Messages.getString("security.61")); //$NON-NLS-1$
         }
         if (issuerNames == null) {
             issuerNames = new ArrayList<String>();
@@ -137,7 +138,7 @@
         }
 
         if (iss_name == null) {
-            iss_name = "";
+            iss_name = ""; //$NON-NLS-1$
         }
 
         String name = new Name(iss_name).getName(X500Principal.CANONICAL);
@@ -151,7 +152,7 @@
      */
     public void addIssuerName(byte[] iss_name) throws IOException {
         if (iss_name == null) {
-            throw new NullPointerException("Provided parameter is null");
+            throw new NullPointerException(Messages.getString("security.63")); //$NON-NLS-1$
         }
         if (issuerNames == null) {
             issuerNames = new ArrayList<String>();
@@ -258,29 +259,29 @@
      */
     public String toString() {
         StringBuffer result = new StringBuffer();
-        result.append("X509CRLSelector:\n[");
+        result.append("X509CRLSelector:\n["); //$NON-NLS-1$
         if (issuerNames != null) {
-            result.append("\n  IssuerNames:\n  [");
+            result.append("\n  IssuerNames:\n  ["); //$NON-NLS-1$
             int size = issuerNames.size();
             for (int i=0; i<size; i++) {
-                result.append("\n    "
+                result.append("\n    " //$NON-NLS-1$
                     + issuerNames.get(i));
             }
-            result.append("\n  ]");
+            result.append("\n  ]"); //$NON-NLS-1$
         }
         if (minCRL != null) {
-            result.append("\n  minCRL: " + minCRL);
+            result.append("\n  minCRL: " + minCRL); //$NON-NLS-1$
         }
         if (maxCRL != null) {
-            result.append("\n  maxCRL: " + maxCRL);
+            result.append("\n  maxCRL: " + maxCRL); //$NON-NLS-1$
         }
         if (dateAndTime != -1) {
-            result.append("\n  dateAndTime: " + (new Date(dateAndTime)));
+            result.append("\n  dateAndTime: " + (new Date(dateAndTime))); //$NON-NLS-1$
         }
         if (certificateChecking != null) {
-            result.append("\n  certificateChecking: " + certificateChecking);
+            result.append("\n  certificateChecking: " + certificateChecking); //$NON-NLS-1$
         }
-        result.append("\n]");
+        result.append("\n]"); //$NON-NLS-1$
         return result.toString();
     }
 
@@ -303,7 +304,7 @@
             try {
                 // As specified in rfc 3280 (http://www.ietf.org/rfc/rfc3280.txt)
                 // CRL Number Extension's OID is 2.5.29.20 .
-                byte[] bytes = crlist.getExtensionValue("2.5.29.20");
+                byte[] bytes = crlist.getExtensionValue("2.5.29.20"); //$NON-NLS-1$
                 bytes = (byte[]) ASN1OctetString.getInstance().decode(bytes);
                 BigInteger crlNumber = new BigInteger((byte[])
                         ASN1Integer.getInstance().decode(bytes));

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CertSelector.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CertSelector.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CertSelector.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CertSelector.java Tue Sep 26 05:46:11 2006
@@ -38,6 +38,7 @@
 import javax.security.auth.x500.X500Principal;
 
 import org.apache.harmony.security.asn1.ASN1OctetString;
+import org.apache.harmony.security.internal.nls.Messages;
 import org.apache.harmony.security.x509.AlgorithmIdentifier;
 import org.apache.harmony.security.x509.CertificatePolicies;
 import org.apache.harmony.security.x509.GeneralName;
@@ -354,17 +355,17 @@
             int comp = Integer.parseInt(oid.substring(beg, end));
             beg = end + 1;
             if ((comp < 0) || (comp > 2)) {
-                throw new IOException("The OID: \"" + oid + "\" is icorrect.");
+                throw new IOException(Messages.getString("security.56", oid)); //$NON-NLS-1$
             }
             end = oid.indexOf('.', beg);
             comp = Integer.parseInt(oid.substring(beg, end));
             if ((comp < 0) || (comp > 39)) {
-                throw new IOException("The OID: \"" + oid + "\" is icorrect.");
+                throw new IOException(Messages.getString("security.56", oid)); //$NON-NLS-1$
             }
         } catch (IndexOutOfBoundsException e) {
-            throw new IOException("The OID: \"" + oid + "\" is icorrect.");
+            throw new IOException(Messages.getString("security.56", oid)); //$NON-NLS-1$
         } catch (NumberFormatException e) {
-            throw new IOException("The OID: \"" + oid + "\" is icorrect.");
+            throw new IOException(Messages.getString("security.56", oid)); //$NON-NLS-1$
         }
     }
 
@@ -501,8 +502,7 @@
             } else if (value instanceof byte[]) {
                 addSubjectAlternativeName(tag, (byte[]) value);
             } else {
-                throw new IOException(
-                        "The name component is not a Stirng or a byte array.");
+                throw new IOException(Messages.getString("security.57")); //$NON-NLS-1$
             }
         }
     }
@@ -590,8 +590,7 @@
      */
     public void setBasicConstraints(int pathLen) {
         if (pathLen < -2) {
-            throw new IllegalArgumentException(
-                        "pathLen criteria should be >= -2");
+            throw new IllegalArgumentException(Messages.getString("security.58")); //$NON-NLS-1$
         }
         this.pathLen = pathLen;
     }
@@ -647,8 +646,7 @@
             } else if (value instanceof byte[]) {
                 addPathToName(tag, (byte[]) value);
             } else {
-                throw new IOException(
-                        "The name component is not a Stirng or a byte array.");
+                throw new IOException(Messages.getString("security.57")); //$NON-NLS-1$
             }
         }
     }
@@ -702,101 +700,101 @@
         // (http://www.ietf.org/rfc/rfc3280.txt).
 
         StringBuffer result = new StringBuffer();
-        result.append("X509CertSelector: \n[");
+        result.append("X509CertSelector: \n["); //$NON-NLS-1$
         if (this.certificateEquals != null) {
-            result.append("\n  certificateEquals: " + certificateEquals);
+            result.append("\n  certificateEquals: " + certificateEquals); //$NON-NLS-1$
         }
         if (this.serialNumber != null) {
             //FIXME: needs DRL's BigInteger.toString implementation
             //result.append("\n  serialNumber: " + serialNumber);
         }
         if (this.issuer != null) {
-            result.append("\n  issuer: " + issuer);
+            result.append("\n  issuer: " + issuer); //$NON-NLS-1$
         }
         if (this.subject != null) {
-            result.append("\n  subject: " + subject);
+            result.append("\n  subject: " + subject); //$NON-NLS-1$
         }
         if (this.subjectKeyIdentifier != null) {
-            result.append("\n  subjectKeyIdentifier: "
+            result.append("\n  subjectKeyIdentifier: " //$NON-NLS-1$
                     + getBytesAsString(subjectKeyIdentifier));
         }
         if (this.authorityKeyIdentifier != null) {
-            result.append("\n  authorityKeyIdentifier: "
+            result.append("\n  authorityKeyIdentifier: " //$NON-NLS-1$
                     + getBytesAsString(authorityKeyIdentifier));
         }
         if (this.certificateValid != null) {
-            result.append("\n  certificateValid: " + certificateValid);
+            result.append("\n  certificateValid: " + certificateValid); //$NON-NLS-1$
         }
         if (this.subjectPublicKeyAlgID != null) {
-            result.append("\n  subjectPublicKeyAlgID: "
+            result.append("\n  subjectPublicKeyAlgID: " //$NON-NLS-1$
                     + subjectPublicKeyAlgID);
         }
         if (this.privateKeyValid != null) {
-            result.append("\n  privateKeyValid: " + privateKeyValid);
+            result.append("\n  privateKeyValid: " + privateKeyValid); //$NON-NLS-1$
         }
         if (this.subjectPublicKey != null) {
-            result.append("\n  subjectPublicKey: "
+            result.append("\n  subjectPublicKey: " //$NON-NLS-1$
                     + getBytesAsString(subjectPublicKey));
         }
         if (this.keyUsage != null) {
-            result.append("\n  keyUsage: \n  [");
+            result.append("\n  keyUsage: \n  ["); //$NON-NLS-1$
             String[] kuNames = new String[] {
-                "digitalSignature", "nonRepudiation", "keyEncipherment",
-                "dataEncipherment", "keyAgreement", "keyCertSign", "cRLSign",
-                "encipherOnly", "decipherOnly"
+                "digitalSignature", "nonRepudiation", "keyEncipherment", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                "dataEncipherment", "keyAgreement", "keyCertSign", "cRLSign", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+                "encipherOnly", "decipherOnly" //$NON-NLS-1$ //$NON-NLS-2$
             };
             for (int i=0; i<9; i++) {
                 if (keyUsage[i]) {
-                    result.append("\n    " + kuNames[i]);
+                    result.append("\n    " + kuNames[i]); //$NON-NLS-1$
                 }
             }
-            result.append("\n  ]");
+            result.append("\n  ]"); //$NON-NLS-1$
         }
         if (this.extendedKeyUsage != null) {
-            result.append("\n  extendedKeyUsage: "
+            result.append("\n  extendedKeyUsage: " //$NON-NLS-1$
                     + extendedKeyUsage.toString());
         }
-        result.append("\n  matchAllNames: " + matchAllNames);
-        result.append("\n  pathLen: " + pathLen);
+        result.append("\n  matchAllNames: " + matchAllNames); //$NON-NLS-1$
+        result.append("\n  pathLen: " + pathLen); //$NON-NLS-1$
         if (this.subjectAltNames != null) {
-            result.append("\n  subjectAltNames:  \n  [");
+            result.append("\n  subjectAltNames:  \n  ["); //$NON-NLS-1$
             for (int i=0; i<9; i++) {
                 List names = this.subjectAltNames[i];
                 if (names != null) {
                     int size = names.size();
                     for (int j=0; j<size; j++) {
-                        result.append("\n    "
+                        result.append("\n    " //$NON-NLS-1$
                             + ((GeneralName)names.get(j)).toString());
                     }
                 }
             }
-            result.append("\n  ]");
+            result.append("\n  ]"); //$NON-NLS-1$
         }
         if (this.nameConstraints != null) {
         }
         if (this.policies != null) {
-            result.append("\n  policies: " + policies.toString());
+            result.append("\n  policies: " + policies.toString()); //$NON-NLS-1$
         }
         if (this.pathToNames != null) {
-            result.append("\n  pathToNames:  \n  [");
+            result.append("\n  pathToNames:  \n  ["); //$NON-NLS-1$
             int size = pathToNames.size();
             for (int i = 0; i < size; i++) {
-                result.append("\n    "
+                result.append("\n    " //$NON-NLS-1$
                     + ((GeneralName)pathToNames.get(i)).toString());
             }
         }
-        result.append("\n]");
+        result.append("\n]"); //$NON-NLS-1$
         return result.toString();
     }
 
     private String getBytesAsString(byte[] data) {
-        String result = "";
+        String result = ""; //$NON-NLS-1$
         for (int i=0; i<data.length; i++) {
             String tail = Integer.toHexString(0x00ff & data[i]);
             if (tail.length() == 1) {
-                tail = "0" + tail;
+                tail = "0" + tail; //$NON-NLS-1$
             }
-            result += tail + " ";
+            result += tail + " "; //$NON-NLS-1$
         }
         return result;
     }
@@ -842,12 +840,12 @@
             !Arrays.equals(subjectKeyIdentifier,
             // Here and later all of the extension OIDs 
             // are taken from rfc 3280 (http://www.ietf.org/rfc/rfc3280.txt)
-                           getExtensionValue(cert, "2.5.29.14"))) {
+                           getExtensionValue(cert, "2.5.29.14"))) { //$NON-NLS-1$
             return false;
         }
         if ((authorityKeyIdentifier != null) &&
             !Arrays.equals(authorityKeyIdentifier,
-                           getExtensionValue(cert, "2.5.29.35"))) {
+                           getExtensionValue(cert, "2.5.29.35"))) { //$NON-NLS-1$
             return false;
         }
         if (certificateValid != null) {
@@ -861,7 +859,7 @@
         }
         if (privateKeyValid != null) {
             try {
-                byte[] bytes = getExtensionValue(cert, "2.5.29.16");
+                byte[] bytes = getExtensionValue(cert, "2.5.29.16"); //$NON-NLS-1$
                 if (bytes == null) {
                     return false;
                 }
@@ -950,7 +948,7 @@
         if (subjectAltNames != null) {
             PASSED:
             try {
-                byte[] bytes = getExtensionValue(cert, "2.5.29.17");
+                byte[] bytes = getExtensionValue(cert, "2.5.29.17"); //$NON-NLS-1$
                 if (bytes == null) {
                     return false;
                 }
@@ -1003,7 +1001,7 @@
             }
         }
         if (policies != null) {
-            byte[] bytes = getExtensionValue(cert, "2.5.29.32");
+            byte[] bytes = getExtensionValue(cert, "2.5.29.32"); //$NON-NLS-1$
             if (bytes == null) {
                 return false;
             }
@@ -1031,7 +1029,7 @@
             }
         }
         if (pathToNames != null) {
-            byte[] bytes = getExtensionValue(cert, "2.5.29.30");
+            byte[] bytes = getExtensionValue(cert, "2.5.29.30"); //$NON-NLS-1$
             if (bytes != null) {
                 NameConstraints nameConstraints;
                 try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509Certificate.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509Certificate.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509Certificate.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509Certificate.java Tue Sep 26 05:46:11 2006
@@ -30,6 +30,8 @@
 
 import javax.security.auth.x500.X500Principal;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -42,7 +44,7 @@
      * @com.intel.drl.spec_ref
      */
     protected X509Certificate() {
-        super("X.509");
+        super("X.509"); //$NON-NLS-1$
     }
 
     /**
@@ -81,7 +83,7 @@
             // TODO if there is no X.509 certificate provider installed
             // should we try to access Harmony X509CertImpl via classForName?
             CertificateFactory factory = CertificateFactory
-                    .getInstance("X.509");
+                    .getInstance("X.509"); //$NON-NLS-1$
 
             X509Certificate cert = (X509Certificate) factory
                     .generateCertificate(new ByteArrayInputStream(getEncoded()));
@@ -89,7 +91,7 @@
             return cert.getIssuerX500Principal();
 
         } catch (Exception e) {
-            throw new RuntimeException("Failed to get X500Principal issuer", e);
+            throw new RuntimeException(Messages.getString("security.59"), e); //$NON-NLS-1$
         }
     }
 
@@ -107,7 +109,7 @@
             // TODO if there is no X.509 certificate provider installed
             // should we try to access Harmony X509CertImpl via classForName?
             CertificateFactory factory = CertificateFactory
-                    .getInstance("X.509");
+                    .getInstance("X.509"); //$NON-NLS-1$
 
             X509Certificate cert = (X509Certificate) factory
                     .generateCertificate(new ByteArrayInputStream(getEncoded()));
@@ -115,7 +117,7 @@
             return cert.getSubjectX500Principal();
 
         } catch (Exception e) {
-            throw new RuntimeException("Failed to get X500Principal subject", e);
+            throw new RuntimeException(Messages.getString("security.5A"), e); //$NON-NLS-1$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECFieldF2m.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECFieldF2m.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECFieldF2m.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECFieldF2m.java Tue Sep 26 05:46:11 2006
@@ -24,6 +24,8 @@
 import java.math.BigInteger;
 import java.util.Arrays;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -50,7 +52,7 @@
     public ECFieldF2m(int m) {
         this.m = m;
         if (this.m <= 0) {
-            throw new IllegalArgumentException("the m is not positive");
+            throw new IllegalArgumentException(Messages.getString("security.75")); //$NON-NLS-1$
         }
         this.rp = null;
         this.ks = null;
@@ -62,11 +64,11 @@
     public ECFieldF2m(int m, BigInteger rp) {
         this.m = m;
         if (this.m <= 0) {
-            throw new IllegalArgumentException("the m is not positive");
+            throw new IllegalArgumentException(Messages.getString("security.75")); //$NON-NLS-1$
         }
         this.rp = rp;
         if (this.rp == null) {
-            throw new NullPointerException("the rp is null");
+            throw new NullPointerException(Messages.getString("security.76")); //$NON-NLS-1$
         }
         // the leftmost bit must be (m+1)-th one,
         // set bits count must be 3 or 5,
@@ -75,7 +77,7 @@
         if ((this.rp.bitLength() != (m+1)) ||
             (rp_bc != TPB_LEN && rp_bc != PPB_LEN) ||
             (!this.rp.testBit(0) || !this.rp.testBit(m)) ) {
-            throw new IllegalArgumentException("the rp is invalid");
+            throw new IllegalArgumentException(Messages.getString("security.77")); //$NON-NLS-1$
         }
 
         // setup ks using rp:
@@ -95,7 +97,7 @@
     public ECFieldF2m(int m, int[] ks) {
         this.m = m;
         if (this.m <= 0) {
-            throw new IllegalArgumentException("the m is not positive");
+            throw new IllegalArgumentException(Messages.getString("security.75")); //$NON-NLS-1$
         }
         // Defensively copies array parameter
         // to prevent subsequent modification.
@@ -106,7 +108,7 @@
         // no need to check for null already
         if (this.ks.length != TPB_MID_LEN && this.ks.length != PPB_MID_LEN) {
             // must be either trinomial or pentanomial basis
-            throw new IllegalArgumentException("the length of ks is invalid");
+            throw new IllegalArgumentException(Messages.getString("security.78")); //$NON-NLS-1$
         }
         // trinomial basis:
         // check that m > k >= 1, where k is ks[0]
@@ -125,7 +127,7 @@
             break;
         }
         if (checkFailed || prev < 1) {
-            throw new IllegalArgumentException("the ks is invalid");
+            throw new IllegalArgumentException(Messages.getString("security.79")); //$NON-NLS-1$
         }
 
         // Setup rp using ks:

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECFieldFp.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECFieldFp.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECFieldFp.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECFieldFp.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 
 import java.math.BigInteger;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -38,10 +40,10 @@
         this.p = p;
 
         if (this.p == null) {
-            throw new NullPointerException("the p is null");
+            throw new NullPointerException(Messages.getString("security.83", "p")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (this.p.signum() != 1) {
-            throw new IllegalArgumentException("the p is not positive");
+            throw new IllegalArgumentException(Messages.getString("security.86", "p")); //$NON-NLS-1$ //$NON-NLS-2$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECGenParameterSpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECGenParameterSpec.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECGenParameterSpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECGenParameterSpec.java Tue Sep 26 05:46:11 2006
@@ -21,6 +21,8 @@
 
 package java.security.spec;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -36,7 +38,7 @@
     public ECGenParameterSpec(String name) {
         this.name = name;
         if (this.name == null) {
-            throw new NullPointerException("the name parameter is null");
+            throw new NullPointerException(Messages.getString("security.83", "name")); //$NON-NLS-1$ //$NON-NLS-2$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECParameterSpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECParameterSpec.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECParameterSpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECParameterSpec.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 
 import java.math.BigInteger;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -48,22 +50,22 @@
         this.cofactor = cofactor;
         // throw NullPointerException if curve, generator or order is null
         if (this.curve == null) {
-            throw new NullPointerException("the curve parameter is null");
+            throw new NullPointerException(Messages.getString("security.83", "curve")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (this.generator == null) {
-            throw new NullPointerException("the generator parameter is null");
+            throw new NullPointerException(Messages.getString("security.83", "generator")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (this.order == null) {
-            throw new NullPointerException("the order parameter is null");
+            throw new NullPointerException(Messages.getString("security.83", "order")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         // throw IllegalArgumentException if order or cofactor is not positive
         if (!(this.order.compareTo(BigInteger.ZERO) > 0)) {
             throw new
-            IllegalArgumentException("the order parameter is not positive");
+            IllegalArgumentException(Messages.getString("security.86", "order")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (!(this.cofactor > 0)) {
             throw new
-            IllegalArgumentException("the cofactor parameter is not positive");
+            IllegalArgumentException(Messages.getString("security.86", "cofactor")); //$NON-NLS-1$ //$NON-NLS-2$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPoint.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPoint.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPoint.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPoint.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 
 import java.math.BigInteger;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -49,11 +51,11 @@
     public ECPoint(BigInteger affineX, BigInteger affineY) {
         this.affineX = affineX;
         if (this.affineX == null) {
-            throw new NullPointerException("the X parameter is null");
+            throw new NullPointerException(Messages.getString("security.83", "X")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         this.affineY = affineY;
         if (this.affineY == null) {
-            throw new NullPointerException("the Y parameter is null");
+            throw new NullPointerException(Messages.getString("security.83", "Y")); //$NON-NLS-1$ //$NON-NLS-2$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPrivateKeySpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPrivateKeySpec.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPrivateKeySpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPrivateKeySpec.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 
 import java.math.BigInteger;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -41,10 +43,10 @@
         this.params = params;
         // throw NullPointerException if s or params is null
         if (this.s == null) {
-            throw new NullPointerException("the s parameter is null");
+            throw new NullPointerException(Messages.getString("security.83", "s")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (this.params == null) {
-            throw new NullPointerException("the params parameter is null");
+            throw new NullPointerException(Messages.getString("security.83", "params")); //$NON-NLS-1$ //$NON-NLS-2$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPublicKeySpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPublicKeySpec.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPublicKeySpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPublicKeySpec.java Tue Sep 26 05:46:11 2006
@@ -21,6 +21,8 @@
 
 package java.security.spec;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -39,15 +41,15 @@
         this.params = params;
         // throw NullPointerException if w or params is null
         if (this.w == null) {
-            throw new NullPointerException("the w parameter is null");
+            throw new NullPointerException(Messages.getString("security.83", "w")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (this.params == null) {
-            throw new NullPointerException("the params parameter is null");
+            throw new NullPointerException(Messages.getString("security.83", "params")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         // throw IllegalArgumentException if w is point at infinity
         if (this.w.equals(ECPoint.POINT_INFINITY)) {
             throw new IllegalArgumentException(
-                "the w parameter is point at infinity");
+                Messages.getString("security.84")); //$NON-NLS-1$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/EllipticCurve.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/EllipticCurve.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/EllipticCurve.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/EllipticCurve.java Tue Sep 26 05:46:11 2006
@@ -24,6 +24,8 @@
 import java.math.BigInteger;
 import java.util.Arrays;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -52,15 +54,15 @@
     public EllipticCurve(ECField field, BigInteger a, BigInteger b, byte[] seed) {
         this.field = field;
         if (this.field == null) {
-            throw new NullPointerException("the field parameter is null");
+            throw new NullPointerException(Messages.getString("security.7A")); //$NON-NLS-1$
         }
         this.a = a;
         if (this.a == null) {
-            throw new NullPointerException("the a parameter is null");
+            throw new NullPointerException(Messages.getString("security.7B")); //$NON-NLS-1$
         }
         this.b = b;
         if (this.b == null) {
-            throw new NullPointerException("the b parameter is null");
+            throw new NullPointerException(Messages.getString("security.7C")); //$NON-NLS-1$
         }
         // make defensive copy
         if (seed == null) {
@@ -75,18 +77,18 @@
         if (this.field instanceof ECFieldFp) {
             BigInteger p = ((ECFieldFp) this.field).getP();
             if (this.a.signum() < 0 || this.a.compareTo(p) >= 0) {
-                throw new IllegalArgumentException("the a is not in the field");
+                throw new IllegalArgumentException(Messages.getString("security.7D")); //$NON-NLS-1$
             }
             if (this.b.signum() < 0 || this.b.compareTo(p) >= 0) {
-                throw new IllegalArgumentException("the a is not in the field");
+                throw new IllegalArgumentException(Messages.getString("security.7E")); //$NON-NLS-1$
             }
         } else if (this.field instanceof ECFieldF2m) {
             int fieldSizeInBits = this.field.getFieldSize();
             if (!(this.a.bitLength() <= fieldSizeInBits)) {
-                throw new IllegalArgumentException("the a is not in the field");
+                throw new IllegalArgumentException(Messages.getString("security.7D")); //$NON-NLS-1$
             }
             if (!(this.b.bitLength() <= fieldSizeInBits)) {
-                throw new IllegalArgumentException("the b is not in the field");
+                throw new IllegalArgumentException(Messages.getString("security.7E")); //$NON-NLS-1$
             }
         }
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/MGF1ParameterSpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/MGF1ParameterSpec.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/MGF1ParameterSpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/MGF1ParameterSpec.java Tue Sep 26 05:46:11 2006
@@ -21,6 +21,8 @@
 
 package java.security.spec;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -30,22 +32,22 @@
      * @com.intel.drl.spec_ref
      */
     public static final MGF1ParameterSpec SHA1 =
-        new MGF1ParameterSpec("SHA-1");
+        new MGF1ParameterSpec("SHA-1"); //$NON-NLS-1$
     /**
      * @com.intel.drl.spec_ref
      */
     public static final MGF1ParameterSpec SHA256 =
-        new MGF1ParameterSpec("SHA-256");
+        new MGF1ParameterSpec("SHA-256"); //$NON-NLS-1$
     /**
      * @com.intel.drl.spec_ref
      */
     public static final MGF1ParameterSpec SHA384 =
-        new MGF1ParameterSpec("SHA-384");
+        new MGF1ParameterSpec("SHA-384"); //$NON-NLS-1$
     /**
      * @com.intel.drl.spec_ref
      */
     public static final MGF1ParameterSpec SHA512 =
-        new MGF1ParameterSpec("SHA-512");
+        new MGF1ParameterSpec("SHA-512"); //$NON-NLS-1$
 
     //  Message digest algorithm name
     private final String mdName;
@@ -56,7 +58,7 @@
     public MGF1ParameterSpec(String mdName) {
         this.mdName = mdName;
         if (this.mdName == null) {
-            throw new NullPointerException("the mdName parameter is null");
+            throw new NullPointerException(Messages.getString("security.80")); //$NON-NLS-1$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/PKCS8EncodedKeySpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/PKCS8EncodedKeySpec.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/PKCS8EncodedKeySpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/PKCS8EncodedKeySpec.java Tue Sep 26 05:46:11 2006
@@ -46,6 +46,6 @@
      * @com.intel.drl.spec_ref
      */
     public final String getFormat() {
-        return "PKCS#8";
+        return "PKCS#8"; //$NON-NLS-1$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/PSSParameterSpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/PSSParameterSpec.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/PSSParameterSpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/PSSParameterSpec.java Tue Sep 26 05:46:11 2006
@@ -21,6 +21,8 @@
 
 package java.security.spec;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -47,11 +49,11 @@
      */
     public PSSParameterSpec(int saltLen) {
         if (saltLen < 0) {
-            throw new IllegalArgumentException("invalid saltLen");
+            throw new IllegalArgumentException(Messages.getString("security.7F")); //$NON-NLS-1$
         }
         this.saltLen = saltLen;
-        this.mdName = "SHA-1";
-        this.mgfName = "MGF1";
+        this.mdName = "SHA-1"; //$NON-NLS-1$
+        this.mgfName = "MGF1"; //$NON-NLS-1$
         this.mgfSpec = MGF1ParameterSpec.SHA1;
         this.trailerField = 1;
     }
@@ -63,16 +65,16 @@
             AlgorithmParameterSpec mgfSpec, int saltLen, int trailerField) {
 
         if (mdName == null) {
-            throw new NullPointerException("mdName is null");
+            throw new NullPointerException(Messages.getString("security.80")); //$NON-NLS-1$
         }
         if (mgfName == null) {
-            throw new NullPointerException("mgfName is null");
+            throw new NullPointerException(Messages.getString("security.81")); //$NON-NLS-1$
         }
         if (saltLen < 0) {
-            throw new IllegalArgumentException("invalid saltLen");
+            throw new IllegalArgumentException(Messages.getString("security.7F")); //$NON-NLS-1$
         }
         if (trailerField < 0) {
-            throw new IllegalArgumentException("invalid trailerField");
+            throw new IllegalArgumentException(Messages.getString("security.82")); //$NON-NLS-1$
         }
         this.mdName = mdName;
         this.mgfName = mgfName;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 
 import java.math.BigInteger;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -61,34 +63,34 @@
 
         // Perform checks specified
         if (modulus == null) {
-            throw new NullPointerException("the modulus is null");
+            throw new NullPointerException(Messages.getString("security.83", "modulus")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (privateExponent == null) {
-            throw new NullPointerException("the privateExponent is null");
+            throw new NullPointerException(Messages.getString("security.83", "privateExponent")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (publicExponent == null) {
-            throw new NullPointerException("the publicExponent is null");
+            throw new NullPointerException(Messages.getString("security.83", "publicExponent")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (primeP == null) {
-            throw new NullPointerException("the primeP is null");
+            throw new NullPointerException(Messages.getString("security.83", "primeP")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (primeQ == null) {
-            throw new NullPointerException("the primeQ is null");
+            throw new NullPointerException(Messages.getString("security.83", "primeQ")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (primeExponentP == null) {
-            throw new NullPointerException("the primeExponentP is null");
+            throw new NullPointerException(Messages.getString("security.83", "primeExponentP")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (primeExponentQ == null) {
-            throw new NullPointerException("the primeExponentQ is null");
+            throw new NullPointerException(Messages.getString("security.83", "primeExponentQ")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (crtCoefficient == null) {
-            throw new NullPointerException("the crtCoefficient is null");
+            throw new NullPointerException(Messages.getString("security.83", "crtCoefficient")); //$NON-NLS-1$ //$NON-NLS-2$
         }
 
         if (otherPrimeInfo != null) {
             if (otherPrimeInfo.length == 0) {
                 throw new IllegalArgumentException(
-                "the otherPrimeInfo length is 0");
+                Messages.getString("security.85")); //$NON-NLS-1$
             }
             // Clone array to prevent subsecuent modification
             this.otherPrimeInfo = new RSAOtherPrimeInfo[otherPrimeInfo.length];

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/RSAOtherPrimeInfo.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/RSAOtherPrimeInfo.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/RSAOtherPrimeInfo.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/RSAOtherPrimeInfo.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 
 import java.math.BigInteger;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -41,13 +43,13 @@
     public RSAOtherPrimeInfo(BigInteger prime,
             BigInteger primeExponent, BigInteger crtCoefficient) {
         if (prime == null) {
-            throw new NullPointerException("the prime is null");
+            throw new NullPointerException(Messages.getString("security.83", "prime")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (primeExponent == null) {
-            throw new NullPointerException("the primeExponent is null");
+            throw new NullPointerException(Messages.getString("security.83", "primeExponent")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         if (crtCoefficient == null) {
-            throw new NullPointerException("the crtCoefficient is null");
+            throw new NullPointerException(Messages.getString("security.83", "crtCoefficient")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         this.prime = prime;
         this.primeExponent = primeExponent;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/X509EncodedKeySpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/X509EncodedKeySpec.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/X509EncodedKeySpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/X509EncodedKeySpec.java Tue Sep 26 05:46:11 2006
@@ -46,6 +46,6 @@
      * @com.intel.drl.spec_ref
      */
     public final String getFormat() {
-        return "X.509";
+        return "X.509"; //$NON-NLS-1$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/javax/security/cert/X509Certificate.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/javax/security/cert/X509Certificate.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/javax/security/cert/X509Certificate.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/javax/security/cert/X509Certificate.java Tue Sep 26 05:46:11 2006
@@ -41,6 +41,8 @@
 import javax.security.cert.CertificateExpiredException;
 import javax.security.cert.CertificateNotYetValidException;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -53,7 +55,7 @@
             String classname = (String) AccessController.doPrivileged(
                 new java.security.PrivilegedAction() {
                     public Object run() {
-                        return Security.getProperty("cert.provider.x509v1");
+                        return Security.getProperty("cert.provider.x509v1"); //$NON-NLS-1$
                     }
                 }
             );
@@ -77,7 +79,7 @@
     public static final X509Certificate getInstance(InputStream inStream)
                                              throws CertificateException {
         if (inStream == null) {
-            throw new CertificateException("The stream should not be null");
+            throw new CertificateException(Messages.getString("security.87")); //$NON-NLS-1$
         }
         if (constructor != null) {
             try {
@@ -90,7 +92,7 @@
 
         final java.security.cert.X509Certificate cert;
         try {
-            CertificateFactory cf = CertificateFactory.getInstance("X.509");
+            CertificateFactory cf = CertificateFactory.getInstance("X.509"); //$NON-NLS-1$
             cert = (java.security.cert.X509Certificate)
                                             cf.generateCertificate(inStream);
         } catch (java.security.cert.CertificateException e) {
@@ -203,7 +205,7 @@
     public static final X509Certificate getInstance(byte[] certData)
                                              throws CertificateException {
         if (certData == null) {
-            throw new CertificateException("The data should not be null");
+            throw new CertificateException(Messages.getString("security.88")); //$NON-NLS-1$
         }
         ByteArrayInputStream bais = new ByteArrayInputStream(certData);
         return getInstance(bais);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/DefaultPolicyScanner.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/DefaultPolicyScanner.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/DefaultPolicyScanner.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/DefaultPolicyScanner.java Tue Sep 26 05:46:11 2006
@@ -28,6 +28,8 @@
 import java.util.HashSet;
 import java.util.List;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * This is a basic high-level tokenizer of policy files. It takes in a stream,
  * analyzes data read from it and returns a set of structured tokens. <br>
@@ -124,13 +126,12 @@
                 break parsing;
 
             case StreamTokenizer.TT_WORD:
-                if ("keystore".equalsIgnoreCase(st.sval)) {
+                if ("keystore".equalsIgnoreCase(st.sval)) { //$NON-NLS-1$
                     keystoreEntries.add(readKeystoreEntry(st));
-                } else if ("grant".equalsIgnoreCase(st.sval)) {
+                } else if ("grant".equalsIgnoreCase(st.sval)) { //$NON-NLS-1$
                     grantEntries.add(readGrantEntry(st));
                 } else {
-                    handleUnexpectedToken(st,
-                            "Expected entries are : \"grant\" or \"keystore\"");
+                    handleUnexpectedToken(st, Messages.getString("security.89")); //$NON-NLS-1$
                 }
                 break;
 
@@ -171,8 +172,7 @@
                 st.pushBack();
             }
         } else {
-            handleUnexpectedToken(st,
-                    "Expected syntax is : keystore \"url\"[, \"type\"]");
+            handleUnexpectedToken(st, Messages.getString("security.8A")); //$NON-NLS-1$
         }
         return ke;
     }
@@ -207,21 +207,19 @@
             switch (st.nextToken()) {
 
             case StreamTokenizer.TT_WORD:
-                if ("signedby".equalsIgnoreCase(st.sval)) {
+                if ("signedby".equalsIgnoreCase(st.sval)) { //$NON-NLS-1$
                     if (st.nextToken() == '"') {
                         ge.signers = st.sval;
                     } else {
-                        handleUnexpectedToken(st,
-                                "Expected syntax is : signedby \"name1,...,nameN\"");
+                        handleUnexpectedToken(st, Messages.getString("security.8B")); //$NON-NLS-1$
                     }
-                } else if ("codebase".equalsIgnoreCase(st.sval)) {
+                } else if ("codebase".equalsIgnoreCase(st.sval)) { //$NON-NLS-1$
                     if (st.nextToken() == '"') {
                         ge.codebase = st.sval;
                     } else {
-                        handleUnexpectedToken(st,
-                                "Expected syntax is : codebase \"url\"");
+                        handleUnexpectedToken(st, Messages.getString("security.8C")); //$NON-NLS-1$
                     }
-                } else if ("principal".equalsIgnoreCase(st.sval)) {
+                } else if ("principal".equalsIgnoreCase(st.sval)) { //$NON-NLS-1$
                     ge.addPrincipal(readPrincipalEntry(st));
                 } else {
                     handleUnexpectedToken(st);
@@ -277,8 +275,7 @@
         } else if (st.ttype == '*') {
             pe.name = PrincipalEntry.WILDCARD;
         } else {
-            handleUnexpectedToken(st, "Expected syntax is : "
-                    + "principal [class_name] \"principal_name\"");
+            handleUnexpectedToken(st, Messages.getString("security.8D")); //$NON-NLS-1$
         }
         return pe;
     }
@@ -310,7 +307,7 @@
             switch (st.nextToken()) {
 
             case StreamTokenizer.TT_WORD:
-                if ("permission".equalsIgnoreCase(st.sval)) {
+                if ("permission".equalsIgnoreCase(st.sval)) { //$NON-NLS-1$
                     PermissionEntry pe = new PermissionEntry();
                     if (st.nextToken() == StreamTokenizer.TT_WORD) {
                         pe.klass = st.sval;
@@ -328,7 +325,7 @@
                             }
                         }
                         if (st.ttype == StreamTokenizer.TT_WORD
-                                && "signedby".equalsIgnoreCase(st.sval)) {
+                                && "signedby".equalsIgnoreCase(st.sval)) { //$NON-NLS-1$
                             if (st.nextToken() == '"') {
                                 pe.signers = st.sval;
                             } else {
@@ -341,9 +338,7 @@
                         continue parsing;
                     }
                 }
-                handleUnexpectedToken(st, "Expected syntax is : permission"
-                        + " permission_class_name [\"target_name\"] [, "
-                        + "\"action_list\"] [, signedby \"name1,...,nameN\"]");
+                handleUnexpectedToken(st, Messages.getString("security.8E")); //$NON-NLS-1$
                 break;
 
             case ';': //just delimiter of entries
@@ -381,8 +376,8 @@
      */
     protected final void handleUnexpectedToken(StreamTokenizer st,
             String message) throws InvalidFormatException {
-        throw new InvalidFormatException("Unexpected token encountered: "
-                + composeStatus(st) + ". " + message);
+        throw new InvalidFormatException(Messages.getString("security.8F", //$NON-NLS-1$
+                composeStatus(st), message));
     }
 
     /**
@@ -394,8 +389,8 @@
      */
     protected final void handleUnexpectedToken(StreamTokenizer st)
             throws InvalidFormatException {
-        throw new InvalidFormatException("Unexpected token encountered: "
-                + composeStatus(st));
+        throw new InvalidFormatException(Messages.getString("security.90", //$NON-NLS-1$
+                composeStatus(st)));
     }
 
     /**
@@ -477,7 +472,7 @@
          * Must be asterisk, for proper general expansion and 
          * PrivateCredentialsPermission wildcarding
          */
-        public static final String WILDCARD = "*";
+        public static final String WILDCARD = "*"; //$NON-NLS-1$
         
         /**
          * The classname part of principal clause.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/PublicKeyImpl.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/PublicKeyImpl.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/PublicKeyImpl.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/PublicKeyImpl.java Tue Sep 26 05:46:11 2006
@@ -58,7 +58,7 @@
     }
 
     public String getFormat() {
-        return "X.509";
+        return "X.509"; //$NON-NLS-1$
     }
 
     public byte[] getEncoded() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/SystemScope.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/SystemScope.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/SystemScope.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/SystemScope.java Tue Sep 26 05:46:11 2006
@@ -28,6 +28,8 @@
 import java.util.Enumeration;
 import java.util.Hashtable;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @see java.security.IdentityScope
  */
@@ -100,19 +102,17 @@
     public synchronized void addIdentity(Identity identity)
             throws KeyManagementException {
         if (identity == null) {
-            throw new NullPointerException("identity is null");
+            throw new NullPointerException(Messages.getString("security.92")); //$NON-NLS-1$
         }
 
         String name = identity.getName();
         if (names.containsKey(name)) {
-            throw new KeyManagementException("name '" + name
-                    + "' is already used");
+            throw new KeyManagementException(Messages.getString("security.93", name)); //$NON-NLS-1$
         }
 
         PublicKey key = identity.getPublicKey();
         if (key != null && keys.containsKey(key)) {
-            throw new KeyManagementException("key '" + key
-                    + "' is already used");
+            throw new KeyManagementException(Messages.getString("security.94", key)); //$NON-NLS-1$
         }
 
         names.put(name, identity);
@@ -129,12 +129,12 @@
 
         //Exception catched = null;
         if (identity == null) {
-            throw new NullPointerException("identity is null");
+            throw new NullPointerException(Messages.getString("security.92")); //$NON-NLS-1$
         }
 
         String name = identity.getName();
         if (name == null) {
-            throw new NullPointerException("invalid identity's name");
+            throw new NullPointerException(Messages.getString("security.95")); //$NON-NLS-1$
         }
 
         boolean contains = names.containsKey(name);
@@ -148,7 +148,7 @@
         }
         
         if (!contains) {
-            throw new KeyManagementException("identity is not found");
+            throw new KeyManagementException(Messages.getString("security.96")); //$NON-NLS-1$
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/UnresolvedPrincipal.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/UnresolvedPrincipal.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/UnresolvedPrincipal.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/UnresolvedPrincipal.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 
 import java.security.Principal;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * Descriptive implementation of Principal, which holds a name and a classname
  * of unresolved principal. It is used to define an arbitrary Principal which
@@ -59,7 +61,7 @@
      */
     public UnresolvedPrincipal(String klass, String name) {
         if (klass == null || klass.length() == 0) {
-            throw new IllegalArgumentException("Class cannot be null or empty");
+            throw new IllegalArgumentException(Messages.getString("security.91")); //$NON-NLS-1$
         }
 
         this.klass = klass;
@@ -136,6 +138,6 @@
      * The format is 'Principal classname &quot;name&quot;'.
      */
     public String toString() {
-        return "Principal " + klass + " \"" + name + "\"";
+        return "Principal " + klass + " \"" + name + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
     }
 }



Mime
View raw message