harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r450032 [1/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
Author: tellison
Date: Tue Sep 26 05:46:11 2006
New Revision: 450032

URL: http://svn.apache.org/viewvc?view=rev&rev=450032
Log:
Apply patch HARMONY-1311 ([classlib][internationalization]Internationalization of the security module)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameterGenerator.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameters.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AllPermission.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AllPermissionCollection.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/BasicPermission.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/BasicPermissionCollection.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/CodeSigner.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/CodeSource.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/DigestInputStream.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/DigestOutputStream.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Identity.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/IdentityScope.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyPairGenerator.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyPairGeneratorSpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyRep.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStoreSpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/MessageDigest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/MessageDigestSpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permission.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permissions.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Policy.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedActionException.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/ProtectionDomain.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SecureRandom.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Security.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signature.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SignatureSpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Signer.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Timestamp.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/UnresolvedPermission.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/UnresolvedPermissionCollection.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPath.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathBuilder.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathValidator.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPathValidatorException.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertStore.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/Certificate.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertificateFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertificateFactorySpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CollectionCertStoreParameters.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/LDAPCertStoreParameters.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXBuilderParameters.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXCertPathBuilderResult.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXCertPathValidatorResult.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXParameters.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PolicyQualifierInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/TrustAnchor.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CRL.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CRLSelector.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CertSelector.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509Certificate.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECFieldF2m.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECFieldFp.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECGenParameterSpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECParameterSpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPoint.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPrivateKeySpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/ECPublicKeySpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/EllipticCurve.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/MGF1ParameterSpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/PKCS8EncodedKeySpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/PSSParameterSpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/RSAOtherPrimeInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/spec/X509EncodedKeySpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/javax/security/cert/X509Certificate.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/DefaultPolicyScanner.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/PublicKeyImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/SystemScope.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/UnresolvedPrincipal.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1BitString.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1Choice.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1Explicit.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1Implicit.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1OpenType.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1StringType.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1Time.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1Type.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1TypeCollection.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ASN1UTCTime.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/BerInputStream.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/BitString.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/DerInputStream.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/asn1/ObjectIdentifier.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicy.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicyParser.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/Engine.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/PolicyUtils.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/SecurityUtils.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/Services.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/internal/nls/messages.properties
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/pkcs10/CertificationRequestInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/pkcs7/ContentInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/pkcs7/SignedData.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/pkcs7/SignerInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/provider/cert/Cache.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/provider/cert/DRLCertFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/provider/cert/X509CRLEntryImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/provider/cert/X509CRLImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/provider/cert/X509CertFactoryImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/provider/cert/X509CertImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/provider/cert/X509CertPathImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/provider/crypto/CryptoProvider.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/provider/crypto/SHA1_Data.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/provider/crypto/SHA1_MessageDigestImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/provider/crypto/SHA1withDSA_SignatureImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/utils/Array.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/utils/JarUtils.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/utils/ObjectIdentifier.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x501/AttributeTypeAndValue.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x501/Name.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/CRLDistributionPoints.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Certificate.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/CertificateList.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/DNParser.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/DistributionPoint.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/Extensions.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralName.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/NameConstraints.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/linux/org/apache/harmony/security/provider/crypto/RandomBitsSupplier.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/windows/org/apache/harmony/security/provider/crypto/RandomBitsSupplier.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameterGenerator.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameterGenerator.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameterGenerator.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameterGenerator.java Tue Sep 26 05:46:11 2006
@@ -24,6 +24,7 @@
 import java.security.spec.AlgorithmParameterSpec;
 
 import org.apache.harmony.security.fortress.Engine;
+import org.apache.harmony.security.internal.nls.Messages;
 
 
 /**
@@ -34,7 +35,7 @@
 public class AlgorithmParameterGenerator {
 
     // Store spi service name
-    private static final String SERVICE = "AlgorithmParameterGenerator";
+    private static final String SERVICE = "AlgorithmParameterGenerator"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
@@ -79,7 +80,7 @@
     public static AlgorithmParameterGenerator 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);
@@ -100,7 +101,7 @@
             NoSuchProviderException {
         if ((provider == null) || (provider.length() == 0)) {
             throw new IllegalArgumentException(
-                    "Provider is null or empty string");
+                    Messages.getString("security.02")); //$NON-NLS-1$
         }
         Provider impProvider = Security.getProvider(provider);
         if (impProvider == null) {
@@ -118,10 +119,10 @@
     public static AlgorithmParameterGenerator 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/AlgorithmParameters.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameters.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameters.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameters.java Tue Sep 26 05:46:11 2006
@@ -26,6 +26,7 @@
 import java.security.spec.InvalidParameterSpecException;
 
 import org.apache.harmony.security.fortress.Engine;
+import org.apache.harmony.security.internal.nls.Messages;
 
 
 /**
@@ -37,7 +38,7 @@
     /**
      * The service name.
      */
-    private static final String SEVICE = "AlgorithmParameters";
+    private static final String SEVICE = "AlgorithmParameters"; //$NON-NLS-1$
 
     /**
      * Used to access common engine functionality
@@ -82,7 +83,7 @@
     public static AlgorithmParameters 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);
@@ -99,13 +100,12 @@
             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", //$NON-NLS-1$
+                    provider));
         }
         return getInstance(algorithm, p);
     }
@@ -117,10 +117,10 @@
     public static AlgorithmParameters 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);
@@ -153,7 +153,7 @@
             throws InvalidParameterSpecException {
         if (initialized) {
             throw new InvalidParameterSpecException(
-                    "Parameter has already been initialized");
+                    Messages.getString("security.1E")); //$NON-NLS-1$
         }
         spiImpl.engineInit(paramSpec);
         initialized = true;
@@ -165,7 +165,7 @@
      */
     public final void init(byte[] params) throws IOException {
         if (initialized) {
-            throw new IOException("Parameter has already been initialized");
+            throw new IOException(Messages.getString("security.1E")); //$NON-NLS-1$
         }
         spiImpl.engineInit(params);
         initialized = true;
@@ -177,7 +177,7 @@
      */
     public final void init(byte[] params, String format) throws IOException {
         if (initialized) {
-            throw new IOException("Parameter has already been initialized");
+            throw new IOException(Messages.getString("security.1E")); //$NON-NLS-1$
         }
         spiImpl.engineInit(params, format);
         initialized = true;
@@ -191,7 +191,7 @@
             throws InvalidParameterSpecException {
         if (!initialized) {
             throw new InvalidParameterSpecException(
-                    "Parameter has not been initialized");
+                    Messages.getString("security.1F")); //$NON-NLS-1$
         }
         return spiImpl.engineGetParameterSpec(paramSpec);
     }
@@ -202,7 +202,7 @@
      */
     public final byte[] getEncoded() throws IOException {
         if (!initialized) {
-            throw new IOException("Parameter has not been initialized");
+            throw new IOException(Messages.getString("security.1F")); //$NON-NLS-1$
         }
         return spiImpl.engineGetEncoded();
     }
@@ -213,7 +213,7 @@
      */
     public final byte[] getEncoded(String format) throws IOException {
         if (!initialized) {
-            throw new IOException("Parameter has not been initialized");
+            throw new IOException(Messages.getString("security.1F")); //$NON-NLS-1$
         }
         return spiImpl.engineGetEncoded(format);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AllPermission.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AllPermission.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AllPermission.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AllPermission.java Tue Sep 26 05:46:11 2006
@@ -30,10 +30,10 @@
     private static final long serialVersionUID = -2916474571451318075L;
 
     // Permission name
-    private static final String ALL_PERMISSIONS = "<all permissions>";
+    private static final String ALL_PERMISSIONS = "<all permissions>"; //$NON-NLS-1$
 
     // Actions name
-    private static final String ALL_ACTIONS = "<all actions>";
+    private static final String ALL_ACTIONS = "<all actions>"; //$NON-NLS-1$
 
 	/**
 	 * Constructs a new instance of this class. The two argument version is

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AllPermissionCollection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AllPermissionCollection.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AllPermissionCollection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AllPermissionCollection.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 import java.util.Enumeration;
 import java.util.NoSuchElementException;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * Specific PermissionCollection for storing AllPermissions. All instances of
  * AllPermission are equivalent, so it is enough to store a single added
@@ -37,7 +39,7 @@
     private static final long serialVersionUID = -4023755556366636806L;
 
     private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField(
-        "all_allowed", Boolean.TYPE), };
+        "all_allowed", Boolean.TYPE), }; //$NON-NLS-1$
 
     // Single element of collection.
     private transient Permission all;
@@ -47,11 +49,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 instanceof AllPermission)) {
-            throw new IllegalArgumentException("invalid permission: "
-                + permission);
+            throw new IllegalArgumentException(Messages.getString("security.16", //$NON-NLS-1$
+                permission));
         }
         all = permission;
     }
@@ -90,7 +92,7 @@
          */
         public E nextElement() {
             if (element == null) {
-                throw new NoSuchElementException("no more elements");
+                throw new NoSuchElementException(Messages.getString("security.17")); //$NON-NLS-1$
             }
             E last = element;
             element = null;
@@ -120,7 +122,7 @@
      */
     private void writeObject(java.io.ObjectOutputStream out) throws IOException {
         ObjectOutputStream.PutField fields = out.putFields();
-        fields.put("all_allowed", all != null);
+        fields.put("all_allowed", all != null); //$NON-NLS-1$
         out.writeFields();
     }
 
@@ -130,7 +132,7 @@
     private void readObject(java.io.ObjectInputStream in) throws IOException,
         ClassNotFoundException {
         ObjectInputStream.GetField fields = in.readFields();
-        if (fields.get("all_allowed", false)) {
+        if (fields.get("all_allowed", false)) { //$NON-NLS-1$
             all = new AllPermission();
         }
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/BasicPermission.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/BasicPermission.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/BasicPermission.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/BasicPermission.java Tue Sep 26 05:46:11 2006
@@ -24,6 +24,8 @@
 import java.io.IOException;
 import java.io.Serializable;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * Superclass of permissions which have names but no action lists.
  * 
@@ -64,10 +66,10 @@
      */ 
     private final void checkName(String name) {
         if (name == null) {
-            throw new NullPointerException("name must not be null");
+            throw new NullPointerException(Messages.getString("security.28")); //$NON-NLS-1$
         }
         if (name.length() == 0) {
-            throw new IllegalArgumentException("name must not be empty");
+            throw new IllegalArgumentException(Messages.getString("security.29")); //$NON-NLS-1$
         }
     }
 
@@ -113,7 +115,7 @@
 	 * @return String the actions associated with the receiver.
 	 */
     public String getActions() {
-        return "";
+        return ""; //$NON-NLS-1$
     }
 
 	/**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/BasicPermissionCollection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/BasicPermissionCollection.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/BasicPermissionCollection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/BasicPermissionCollection.java Tue Sep 26 05:46:11 2006
@@ -28,6 +28,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * Specific PermissionCollection for storing BasicPermissions of arbitrary type.
  * 
@@ -38,9 +40,9 @@
     private static final long serialVersionUID = 739301742472979399L;
 
     private static final ObjectStreamField[] serialPersistentFields = {
-        new ObjectStreamField("all_allowed", Boolean.TYPE),
-        new ObjectStreamField("permissions", Hashtable.class),
-        new ObjectStreamField("permClass", Class.class), };
+        new ObjectStreamField("all_allowed", Boolean.TYPE), //$NON-NLS-1$
+        new ObjectStreamField("permissions", Hashtable.class), //$NON-NLS-1$
+        new ObjectStreamField("permClass", Class.class), }; //$NON-NLS-1$
 
     //should be final, but because of writeObject() cannot be
     private transient Map<String, Permission> items = new HashMap<String, Permission>();
@@ -59,27 +61,27 @@
      */
     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 IllegalArgumentException("invalid permission: null");
+            throw new IllegalArgumentException(Messages.getString("security.20")); //$NON-NLS-1$
         }
 
         Class<? extends Permission> inClass = permission.getClass();
         if (permClass != null) {
             if (permClass != inClass) {
-                throw new IllegalArgumentException("invalid permission: "
-                    + permission);
+                throw new IllegalArgumentException(Messages.getString("security.16", //$NON-NLS-1$
+                    permission));
             }
         } else if( !(permission instanceof BasicPermission)) {
-            throw new IllegalArgumentException("invalid permission: "
-                + permission);
+            throw new IllegalArgumentException(Messages.getString("security.16", //$NON-NLS-1$
+                permission));
         } else { 
             // this is the first element provided that another thread did not add
             synchronized (items) {
                 if (permClass != null && inClass != permClass) {
-                    throw new IllegalArgumentException("invalid permission: "
-                        + permission);
+                    throw new IllegalArgumentException(Messages.getString("security.16", //$NON-NLS-1$
+                        permission));
                 }
                 permClass = inClass;
             }
@@ -160,9 +162,9 @@
      */
     private void writeObject(java.io.ObjectOutputStream out) throws IOException {
         ObjectOutputStream.PutField fields = out.putFields();
-        fields.put("all_allowed", allEnabled);
-        fields.put("permissions", new Hashtable<String, Permission>(items));
-        fields.put("permClass", permClass);
+        fields.put("all_allowed", allEnabled); //$NON-NLS-1$
+        fields.put("permissions", new Hashtable<String, Permission>(items)); //$NON-NLS-1$
+        fields.put("permClass", permClass); //$NON-NLS-1$
         out.writeFields();
     }
 
@@ -176,19 +178,17 @@
 
         items = new HashMap<String, Permission>();
         synchronized (items) {
-            permClass = (Class<? extends Permission>)fields.get("permClass", null);
+            permClass = (Class<? extends Permission>)fields.get("permClass", null); //$NON-NLS-1$
             items.putAll((Hashtable<String, Permission>) fields.get(
-                    "permissions", new Hashtable<String, Permission>()));
+                    "permissions", new Hashtable<String, Permission>())); //$NON-NLS-1$
             for (Iterator<Permission> iter = items.values().iterator(); iter.hasNext();) {
                 if (iter.next().getClass() != permClass) {
-                    throw new InvalidObjectException(
-                        "Inconsistent types of contained permissions");
+                    throw new InvalidObjectException(Messages.getString("security.24")); //$NON-NLS-1$
                 }
             }
-            allEnabled = fields.get("all_allowed", false);
-            if (allEnabled && !items.containsKey("*")) {
-                throw new InvalidObjectException(
-                    "Invalid state of wildcard flag");
+            allEnabled = fields.get("all_allowed", false); //$NON-NLS-1$
+            if (allEnabled && !items.containsKey("*")) { //$NON-NLS-1$
+                throw new InvalidObjectException(Messages.getString("security.25")); //$NON-NLS-1$
             }
         }
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/CodeSigner.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/CodeSigner.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/CodeSigner.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/CodeSigner.java Tue Sep 26 05:46:11 2006
@@ -24,6 +24,8 @@
 import java.io.Serializable;
 import java.security.cert.CertPath;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref 
  */
@@ -53,7 +55,7 @@
      */
     public CodeSigner(CertPath signerCertPath, Timestamp timestamp) {
         if (signerCertPath == null) {
-            throw new NullPointerException("signerCertPath cannot be null");
+            throw new NullPointerException(Messages.getString("security.10")); //$NON-NLS-1$
         }
         this.signerCertPath = signerCertPath;
         this.timestamp = timestamp;
@@ -111,11 +113,11 @@
         StringBuffer buf = new StringBuffer(256);
         // The javadoc says nothing, and the others implementations behavior seems as 
         // dumping only the first certificate. Well, let's do the same.
-        buf.append("CodeSigner [").append(signerCertPath.getCertificates().get(0));
+        buf.append("CodeSigner [").append(signerCertPath.getCertificates().get(0)); //$NON-NLS-1$
         if( timestamp != null ) {
-            buf.append("; ").append(timestamp);
+            buf.append("; ").append(timestamp); //$NON-NLS-1$
         }
-        buf.append("]");
+        buf.append("]"); //$NON-NLS-1$
         return buf.toString();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/CodeSource.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/CodeSource.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/CodeSource.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/CodeSource.java Tue Sep 26 05:46:11 2006
@@ -41,6 +41,7 @@
 import javax.security.auth.x500.X500Principal;
 
 import org.apache.harmony.security.fortress.PolicyUtils;
+import org.apache.harmony.security.internal.nls.Messages;
 
 public class CodeSource implements Serializable {
 
@@ -250,7 +251,7 @@
     private CertPath makeCertPath(List<? extends Certificate> list) {
         if (factory == null) {
             try {
-                factory = CertificateFactory.getInstance("X.509");
+                factory = CertificateFactory.getInstance("X.509"); //$NON-NLS-1$
             } catch (CertificateException ex) {
                 //? throw new Error("X.509 is a 'must be'", ex);
                 return null;
@@ -364,8 +365,8 @@
                 // if( !(thisIsLocalHost && thatIsLocalHost) &&
                 // !thisHost.equals(thatHost)) {
 
-                if (!((thisHost.length() == 0 || "localhost".equals(thisHost)) && (thatHost
-                        .length() == 0 || "localhost".equals(thatHost)))
+                if (!((thisHost.length() == 0 || "localhost".equals(thisHost)) && (thatHost //$NON-NLS-1$
+                        .length() == 0 || "localhost".equals(thatHost))) //$NON-NLS-1$
                         && !thisHost.equals(thatHost)) {
 
                     // Obvious, but veeery slooooow waaaaaaay....
@@ -381,11 +382,11 @@
                     // let's cache it: 
 
                     if (this.sp == null) {
-                        this.sp = new SocketPermission(thisHost, "resolve");
+                        this.sp = new SocketPermission(thisHost, "resolve"); //$NON-NLS-1$
                     }
 
                     if (cs.sp == null) {
-                        cs.sp = new SocketPermission(thatHost, "resolve");
+                        cs.sp = new SocketPermission(thatHost, "resolve"); //$NON-NLS-1$
                     }
 
                     if (!this.sp.implies(cs.sp)) {
@@ -405,25 +406,25 @@
             String thisFile = this.location.getFile();
             String thatFile = cs.location.getFile();
 
-            if (thisFile.endsWith("/-")) { //javadoc:3.6."/-"
+            if (thisFile.endsWith("/-")) { //javadoc:3.6."/-" //$NON-NLS-1$
                 if (!thatFile.startsWith(thisFile.substring(0, thisFile
                         .length() - 2))) {
                     return false;
                 }
-            } else if (thisFile.endsWith("/*")) { //javadoc:3.6."/*"
+            } else if (thisFile.endsWith("/*")) { //javadoc:3.6."/*" //$NON-NLS-1$
                 if (!thatFile.startsWith(thisFile.substring(0, thisFile
                         .length() - 2))) {
                     return false;
                 }
                 // no further separators(s) allowed
-                if (thatFile.indexOf("/", thisFile.length() - 1) != -1) {
+                if (thatFile.indexOf("/", thisFile.length() - 1) != -1) { //$NON-NLS-1$
                     return false;
                 }
             } else {
                 // javadoc:3.6."/"
                 if (!thisFile.equals(thatFile)) {
-                    if (!thisFile.endsWith("/")) {
-                        if (!thatFile.equals(thisFile + "/")) {
+                    if (!thisFile.endsWith("/")) { //$NON-NLS-1$
+                        if (!thatFile.equals(thisFile + "/")) { //$NON-NLS-1$
                             return false;
                         }
                     } else {
@@ -456,24 +457,24 @@
 	 */
     public String toString() {
         StringBuilder buf = new StringBuilder();
-        buf.append("CodeSource, url=");
-        buf.append(location == null ? "<null>" : location.toString());
+        buf.append("CodeSource, url="); //$NON-NLS-1$
+        buf.append(location == null ? "<null>" : location.toString()); //$NON-NLS-1$
 
         if (certs == null) {
-            buf.append(", <no certificates>");
+            buf.append(", <no certificates>"); //$NON-NLS-1$
         } else {
-            buf.append("\nCertificates [\n");
+            buf.append("\nCertificates [\n"); //$NON-NLS-1$
             for (int i = 0; i < certs.length; i++) {
-                buf.append(i + 1).append(") ").append(certs[i]).append("\n");
+                buf.append(i + 1).append(") ").append(certs[i]).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
             }
-            buf.append("]\n");
+            buf.append("]\n"); //$NON-NLS-1$
         }
         if (signers != null) {
-            buf.append("\nCodeSigners [\n");
+            buf.append("\nCodeSigners [\n"); //$NON-NLS-1$
             for (int i = 0; i < signers.length; i++) {
-                buf.append(i + 1).append(") ").append(signers[i]).append("\n");
+                buf.append(i + 1).append(") ").append(signers[i]).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
             }
-            buf.append("]\n");
+            buf.append("]\n"); //$NON-NLS-1$
         }
         return buf.toString();
     }
@@ -493,7 +494,7 @@
                     oos.write(data);
                 } catch (CertificateEncodingException ex) {
                     throw (IOException) new IOException(
-                            "Could not store certificate").initCause(ex);
+                            Messages.getString("security.18")).initCause(ex); //$NON-NLS-1$
                 }
             }
         }
@@ -516,7 +517,7 @@
                     factory = CertificateFactory.getInstance(type);
                 } catch (CertificateException ex) {
                     throw new ClassNotFoundException(
-                            "Could not find CertificateFactory of type " + type,
+                            Messages.getString("security.19", type), //$NON-NLS-1$
                             ex);
                 }
                 int dataLen = ois.readInt();
@@ -527,7 +528,7 @@
                     certs[i] = factory.generateCertificate(bais);
                 } catch (CertificateException ex) {
                     throw (IOException) new IOException(
-                            "Could not generate certificate").initCause(ex);
+                            Messages.getString("security.1A")).initCause(ex); //$NON-NLS-1$
                 }
             }
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/DigestInputStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/DigestInputStream.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/DigestInputStream.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/DigestInputStream.java Tue Sep 26 05:46:11 2006
@@ -136,7 +136,7 @@
 	 * @return String a printable representation for the receiver.
 	 */
     public String toString() {
-        return super.toString() + ", " + digest.toString() +
-            (isOn ? ", is on" : ", is off");
+        return super.toString() + ", " + digest.toString() + //$NON-NLS-1$
+            (isOn ? ", is on" : ", is off"); //$NON-NLS-1$ //$NON-NLS-2$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/DigestOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/DigestOutputStream.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/DigestOutputStream.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/DigestOutputStream.java Tue Sep 26 05:46:11 2006
@@ -121,7 +121,7 @@
 	 * @return String a printable representation for the receiver.
 	 */
     public String toString() {
-        return super.toString() + ", " + digest.toString() +
-            (isOn ? ", is on" : ", is off");
+        return super.toString() + ", " + digest.toString() + //$NON-NLS-1$
+            (isOn ? ", is on" : ", is off"); //$NON-NLS-1$ //$NON-NLS-2$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Identity.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Identity.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Identity.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Identity.java Tue Sep 26 05:46:11 2006
@@ -25,6 +25,8 @@
 import java.util.Vector;
 import java.util.Arrays;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * 
  * @deprecated
@@ -36,7 +38,7 @@
 
     private PublicKey publicKey;
 
-    private String info = "no additional info";
+    private String info = "no additional info"; //$NON-NLS-1$
 
     private IdentityScope scope;
 
@@ -62,13 +64,12 @@
             throws KeyManagementException {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("addIdentityCertificate");
+            sm.checkSecurityAccess("addIdentityCertificate"); //$NON-NLS-1$
         }
         PublicKey certPK = certificate.getPublicKey();
         if (publicKey != null) {
             if (!checkKeysEqual(publicKey, certPK)) {
-                throw new KeyManagementException("Cert's public key does not"
-                        + " match Identity's public key");
+                throw new KeyManagementException(Messages.getString("security.13")); //$NON-NLS-1$
             }
         } else {
             publicKey = certPK;
@@ -107,7 +108,7 @@
             throws KeyManagementException {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("removeIdentityCertificate");
+            sm.checkSecurityAccess("removeIdentityCertificate"); //$NON-NLS-1$
         }
         if (certificates != null) {
             certificates.removeElement(certificate);
@@ -147,7 +148,7 @@
     public String toString(boolean detailed) {
         String s = toString();
         if (detailed) {
-            s += " " + info;
+            s += " " + info; //$NON-NLS-1$
         }
         return s;
     }
@@ -165,14 +166,14 @@
     public void setPublicKey(PublicKey key) throws KeyManagementException {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("setIdentityPublicKey");
+            sm.checkSecurityAccess("setIdentityPublicKey"); //$NON-NLS-1$
         }
         // this check does not always work  
         if ((scope != null) && (key != null)) {
             Identity i = scope.getIdentity(key);
             //System.out.println("###DEBUG## Identity: "+i);
             if ((i != null) && (i != this)) {
-                throw new KeyManagementException("key already used in scope");
+                throw new KeyManagementException(Messages.getString("security.14")); //$NON-NLS-1$
             }
         }
         this.publicKey = key;
@@ -192,7 +193,7 @@
     public void setInfo(String info) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("setIdentityInfo");
+            sm.checkSecurityAccess("setIdentityInfo"); //$NON-NLS-1$
         }
         this.info = info;
     }
@@ -249,11 +250,11 @@
     public String toString() {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("printIdentity");
+            sm.checkSecurityAccess("printIdentity"); //$NON-NLS-1$
         }
         String s = this.name;
         if (scope != null) {
-            s += " [" + scope.getName() + "]";
+            s += " [" + scope.getName() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
         }
         return s;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/IdentityScope.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/IdentityScope.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/IdentityScope.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/IdentityScope.java Tue Sep 26 05:46:11 2006
@@ -68,7 +68,7 @@
     public static IdentityScope getSystemScope() {
 
         if (systemScope == null) {
-            systemScope = new SystemScope("System Scope");
+            systemScope = new SystemScope("System Scope"); //$NON-NLS-1$
         }
         return systemScope;
     }
@@ -79,7 +79,7 @@
     protected static void setSystemScope(IdentityScope scope) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            sm.checkSecurityAccess("setSystemScope");
+            sm.checkSecurityAccess("setSystemScope"); //$NON-NLS-1$
         }
         systemScope = scope;
     }
@@ -128,6 +128,6 @@
      */
     public String toString() {
         return new StringBuffer(super.toString())
-                .append("[").append(size()).append("]").toString();
+                .append("[").append(size()).append("]").toString(); //$NON-NLS-1$ //$NON-NLS-2$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactory.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactory.java Tue Sep 26 05:46:11 2006
@@ -25,6 +25,7 @@
 import java.security.spec.KeySpec;
 
 import org.apache.harmony.security.fortress.Engine;
+import org.apache.harmony.security.internal.nls.Messages;
 
 
 /**
@@ -34,7 +35,7 @@
 
 public class KeyFactory {
     // The service name.
-    private static final String SERVICE = "KeyFactory";
+    private static final String SERVICE = "KeyFactory"; //$NON-NLS-1$
     
     // The provider
     private Provider provider;
@@ -68,7 +69,7 @@
     public static KeyFactory 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);
@@ -83,12 +84,11 @@
     public static KeyFactory 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$ //$NON-NLS-2$
         }
         return getInstance(algorithm, p);    
     }
@@ -100,10 +100,10 @@
     public static KeyFactory 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/KeyPairGenerator.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyPairGenerator.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyPairGenerator.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyPairGenerator.java Tue Sep 26 05:46:11 2006
@@ -24,6 +24,7 @@
 import java.security.spec.AlgorithmParameterSpec;
 
 import org.apache.harmony.security.fortress.Engine;
+import org.apache.harmony.security.internal.nls.Messages;
 
 
 /**
@@ -34,7 +35,7 @@
 public abstract class KeyPairGenerator extends KeyPairGeneratorSpi {
 
     // Store KeyPairGenerator SERVICE name
-    private static final String SERVICE = "KeyPairGenerator";
+    private static final String SERVICE = "KeyPairGenerator"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
@@ -72,7 +73,7 @@
     public static KeyPairGenerator getInstance(String algorithm)
             throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("algorithm is null");
+            throw new NullPointerException(Messages.getString("security.01")); //$NON-NLS-1$
         }
         KeyPairGenerator result;
         synchronized (engine) {
@@ -100,7 +101,7 @@
             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 impProvider = Security.getProvider(provider);
         if (impProvider == null) {
@@ -118,10 +119,10 @@
     public static KeyPairGenerator 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$
         }
         KeyPairGenerator result;
         synchronized (engine) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyPairGeneratorSpi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyPairGeneratorSpi.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyPairGeneratorSpi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyPairGeneratorSpi.java Tue Sep 26 05:46:11 2006
@@ -23,6 +23,8 @@
 
 import java.security.spec.AlgorithmParameterSpec;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -54,7 +56,6 @@
      */
     public void initialize(AlgorithmParameterSpec params, SecureRandom random)
             throws InvalidAlgorithmParameterException {
-        throw new UnsupportedOperationException(
-                "Method initialize(AlgorithmParameterSpec params, SecureRandom random)is not supported");
+        throw new UnsupportedOperationException(Messages.getString("security.2E")); //$NON-NLS-1$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyRep.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyRep.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyRep.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyRep.java Tue Sep 26 05:46:11 2006
@@ -32,6 +32,8 @@
 
 import javax.crypto.spec.SecretKeySpec;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -60,16 +62,16 @@
         this.format = format;
         this.encoded = encoded;
         if(this.type == null) {
-            throw new NullPointerException("the type parameter is null");
+            throw new NullPointerException(Messages.getString("security.07")); //$NON-NLS-1$
         }
         if(this.algorithm == null) {
-            throw new NullPointerException("the algorithm parameter is null");
+            throw new NullPointerException(Messages.getString("security.08")); //$NON-NLS-1$
         }
         if(this.format == null) {
-            throw new NullPointerException("the format parameter is null");
+            throw new NullPointerException(Messages.getString("security.09")); //$NON-NLS-1$
         }
         if(this.encoded == null) {
-            throw new NullPointerException("the encoded parameter is null");
+            throw new NullPointerException(Messages.getString("security.0A")); //$NON-NLS-1$
         }
     }
 
@@ -79,53 +81,50 @@
     protected Object readResolve() throws ObjectStreamException {
         switch (type) {
         case SECRET:
-            if ("RAW".equals(format)) {
+            if ("RAW".equals(format)) { //$NON-NLS-1$
                 try {
                     return new SecretKeySpec(encoded, algorithm);
                 } catch (IllegalArgumentException e) {
                     throw new NotSerializableException(
-                            "Could not create SecretKeySpec: " + e);
+                            Messages.getString("security.0B", e)); //$NON-NLS-1$
                 }
             }
             throw new NotSerializableException(
-                "unrecognized type/format combination: " +
-                type + "/" + format);
+                Messages.getString("security.0C", type, format)); //$NON-NLS-1$
         case PUBLIC:
-            if ("X.509".equals(format)) {
+            if ("X.509".equals(format)) { //$NON-NLS-1$
                 try {
                     KeyFactory kf = KeyFactory.getInstance(algorithm);
                     return kf.generatePublic(new X509EncodedKeySpec(encoded));
                 } catch (NoSuchAlgorithmException e) {
                     throw new NotSerializableException(
-                            "Could not resolute key: " + e);
+                            Messages.getString("security.0D", e)); //$NON-NLS-1$
                 }
                 catch (InvalidKeySpecException e) {
                     throw new NotSerializableException(
-                            "Could not resolute key: " + e);
+                            Messages.getString("security.0D", e)); //$NON-NLS-1$
                 }
             }
             throw new NotSerializableException(
-                "unrecognized type/format combination: " +
-                type + "/" + format);
+                Messages.getString("security.0C", type, format)); //$NON-NLS-1$
         case PRIVATE:
-            if ("PKCS#8".equals(format)) {
+            if ("PKCS#8".equals(format)) { //$NON-NLS-1$
                 try {
                     KeyFactory kf = KeyFactory.getInstance(algorithm);
                     return kf.generatePrivate(new PKCS8EncodedKeySpec(encoded));
                 } catch (NoSuchAlgorithmException e) {
                     throw new NotSerializableException(
-                            "Could not resolute key: " + e);
+                            Messages.getString("security.0D", e)); //$NON-NLS-1$
                 }
                 catch (InvalidKeySpecException e) {
                     throw new NotSerializableException(
-                            "Could not resolute key: " + e);
+                            Messages.getString("security.0D", e)); //$NON-NLS-1$
                 }
             }
             throw new NotSerializableException(
-                "unrecognized type/format combination: " +
-                type + "/" + format);
+                Messages.getString("security.0C", type, format)); //$NON-NLS-1$
         }
-        throw new NotSerializableException("unrecognized key type: " + type);
+        throw new NotSerializableException(Messages.getString("security.0E", type)); //$NON-NLS-1$
     }
 
     // Makes deffensive copy of key encoding

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java Tue Sep 26 05:46:11 2006
@@ -38,24 +38,25 @@
 import javax.security.auth.callback.CallbackHandler;
 
 import org.apache.harmony.security.fortress.Engine;
+import org.apache.harmony.security.internal.nls.Messages;
 
 
 public class KeyStore {
 
     // Store KeyStore SERVICE name
-    private static final String SERVICE = "KeyStore";
+    private static final String SERVICE = "KeyStore"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
 
     //  Store KeyStore property name
-    private static final String PROPERTYNAME = "keystore.type";
+    private static final String PROPERTYNAME = "keystore.type"; //$NON-NLS-1$
 
     //  Store default KeyStore type
-    private static final String DEFAULT_KEYSTORE_TYPE = "jks";
+    private static final String DEFAULT_KEYSTORE_TYPE = "jks"; //$NON-NLS-1$
 
     // Message to report about non-initialized key store object
-    private static final String NOTINITKEYSTORE = "KeyStore was not initialized";
+    private static final String NOTINITKEYSTORE = Messages.getString("security.4F"); //$NON-NLS-1$
 
     // Store KeyStore state (initialized or not)
     private boolean isInit;
@@ -81,7 +82,7 @@
      */
     public static KeyStore getInstance(String type) throws KeyStoreException {
         if (type == null) {
-            throw new NullPointerException("type is null");
+            throw new NullPointerException(Messages.getString("security.07")); //$NON-NLS-1$
         }
         synchronized (engine) {
             try {
@@ -102,7 +103,7 @@
     public static KeyStore getInstance(String type, String provider)
             throws KeyStoreException, 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) {
@@ -125,10 +126,10 @@
             throws KeyStoreException {
         // check parameters
         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$
         }
         // return KeyStore instance
         synchronized (engine) {
@@ -235,16 +236,15 @@
             throw new KeyStoreException(NOTINITKEYSTORE);
         }
         if (alias == null) {
-            throw new NullPointerException("alias is null");
+            throw new NullPointerException(Messages.getString("security.3F")); //$NON-NLS-1$
         }
         if (key == null) {
-            throw new KeyStoreException("key is null");
+            throw new KeyStoreException(Messages.getString("security.2C")); //$NON-NLS-1$
         }
         // Certificate chain is required for PrivateKey
         if ((key instanceof PrivateKey)
                 && ((chain == null) || chain.length == 0)) {
-            throw new KeyStoreException(
-                    "Certificate chain is not defined for Private key ");
+            throw new KeyStoreException(Messages.getString("security.52")); //$NON-NLS-1$
         }
         implSpi.engineSetKeyEntry(alias, key, password, chain);
     }
@@ -273,7 +273,7 @@
             throw new KeyStoreException(NOTINITKEYSTORE);
         }
         if (alias == null) {
-            throw new NullPointerException("alias is null");
+            throw new NullPointerException(Messages.getString("security.3F")); //$NON-NLS-1$
         }
         implSpi.engineSetCertificateEntry(alias, cert);
     }
@@ -288,7 +288,7 @@
             throw new KeyStoreException(NOTINITKEYSTORE);
         }
         if (alias == null) {
-            throw new NullPointerException("alias is null");
+            throw new NullPointerException(Messages.getString("security.3F")); //$NON-NLS-1$
         }
         implSpi.engineDeleteEntry(alias);
     }
@@ -314,7 +314,7 @@
             throw new KeyStoreException(NOTINITKEYSTORE);
         }
         if (alias == null) {
-            throw new NullPointerException("alias is null");
+            throw new NullPointerException(Messages.getString("security.3F")); //$NON-NLS-1$
         }
         return implSpi.engineContainsAlias(alias);
     }
@@ -341,7 +341,7 @@
             throw new KeyStoreException(NOTINITKEYSTORE);
         }
         if (alias == null) {
-            throw new NullPointerException("alias is null");
+            throw new NullPointerException(Messages.getString("security.3F")); //$NON-NLS-1$
         }
         return implSpi.engineIsKeyEntry(alias);
     }
@@ -358,7 +358,7 @@
             throw new KeyStoreException(NOTINITKEYSTORE);
         }
         if (alias == null) {
-            throw new NullPointerException("alias is null");
+            throw new NullPointerException(Messages.getString("security.3F")); //$NON-NLS-1$
         }
         return implSpi.engineIsCertificateEntry(alias);
     }
@@ -387,10 +387,10 @@
             throw new KeyStoreException(NOTINITKEYSTORE);
         }
         if (stream == null) {
-            throw new IOException("stream is null");
+            throw new IOException(Messages.getString("security.51")); //$NON-NLS-1$
         }
         if (password == null) {
-            throw new IOException("password is null");
+            throw new IOException(Messages.getString("security.50")); //$NON-NLS-1$
         }
         implSpi.engineStore(stream, password);
     }
@@ -405,7 +405,7 @@
             throw new KeyStoreException(NOTINITKEYSTORE);
         }
         if (param == null) {
-            throw new IOException("LoadSroreParameter is null");
+            throw new IOException(Messages.getString("security.3E")); //$NON-NLS-1$
         }
         implSpi.engineStore(param);
     }
@@ -427,7 +427,7 @@
     public final void load(LoadStoreParameter param) throws IOException,
             NoSuchAlgorithmException, CertificateException {
         if (param == null) {
-            throw new IOException("LoadSroreParameter is null");
+            throw new IOException(Messages.getString("security.3E")); //$NON-NLS-1$
         }
         implSpi.engineLoad(param);
         isInit = true;
@@ -441,7 +441,7 @@
             throws NoSuchAlgorithmException, UnrecoverableEntryException,
             KeyStoreException {
         if (alias == null) {
-            throw new NullPointerException("alias is null");
+            throw new NullPointerException(Messages.getString("security.3F")); //$NON-NLS-1$
         }
         if (!isInit) {
             throw new KeyStoreException(NOTINITKEYSTORE);
@@ -461,10 +461,10 @@
             throw new KeyStoreException(NOTINITKEYSTORE);
         }
         if (alias == null) {
-            throw new NullPointerException("alias is null");
+            throw new NullPointerException(Messages.getString("security.3F")); //$NON-NLS-1$
         }
         if (entry == null) {
-            throw new NullPointerException("entry is null");
+            throw new NullPointerException(Messages.getString("security.39")); //$NON-NLS-1$
         }
         implSpi.engineSetEntry(alias, entry, param);
     }
@@ -476,10 +476,10 @@
             Class<? extends KeyStore.Entry> entryClass)
             throws KeyStoreException {
         if (alias == null) {
-            throw new NullPointerException("alias is null");
+            throw new NullPointerException(Messages.getString("security.3F")); //$NON-NLS-1$
         }
         if (entryClass == null) {
-            throw new NullPointerException("entryClass is null");
+            throw new NullPointerException(Messages.getString("security.40")); //$NON-NLS-1$
         }
 
         if (!isInit) {
@@ -521,10 +521,10 @@
         public static Builder newInstance(KeyStore keyStore,
                 ProtectionParameter protectionParameter) {
             if (keyStore == null) {
-                throw new NullPointerException("keystore is null");
+                throw new NullPointerException(Messages.getString("security.41")); //$NON-NLS-1$
             }
             if (protectionParameter == null) {
-                throw new NullPointerException("protectionParameter is null");
+                throw new NullPointerException(Messages.getString("security.42")); //$NON-NLS-1$
             }
 
             if (!keyStore.isInit) {
@@ -542,29 +542,26 @@
                 File file, ProtectionParameter protectionParameter) {
             // check null parameters
             if (type == null) {
-                throw new NullPointerException("type  is null");
+                throw new NullPointerException(Messages.getString("security.07")); //$NON-NLS-1$
             }
             if (protectionParameter == null) {
-                throw new NullPointerException("protectionParameter is null");
+                throw new NullPointerException(Messages.getString("security.42")); //$NON-NLS-1$
             }
             if (file == null) {
-                throw new NullPointerException("file is null");
+                throw new NullPointerException(Messages.getString("security.43")); //$NON-NLS-1$
             }
             // protection parameter should be PasswordProtection or
             // CallbackHandlerProtection
             if (!(protectionParameter instanceof PasswordProtection)
                     && !(protectionParameter instanceof CallbackHandlerProtection)) {
-                throw new IllegalArgumentException(
-                        "protectionParameter is neither PasswordProtection nor CallbackHandlerProtection instance");
+                throw new IllegalArgumentException(Messages.getString("security.35")); //$NON-NLS-1$
             }
             // check file parameter
             if (!file.exists()) {
-                throw new IllegalArgumentException("File: " + file.getName()
-                        + " does not exist");
+                throw new IllegalArgumentException(Messages.getString("security.44", file.getName())); //$NON-NLS-1$
             }
             if (!file.isFile()) {
-                throw new IllegalArgumentException(file.getName()
-                        + " does not refer to a normal file");
+                throw new IllegalArgumentException(Messages.getString("security.45", file.getName())); //$NON-NLS-1$
             }
             // create new instance
             return new BuilderImpl(null, protectionParameter, file,
@@ -578,10 +575,10 @@
         public static Builder newInstance(String type, Provider provider,
                 ProtectionParameter protectionParameter) {
             if (type == null) {
-                throw new NullPointerException("type is null");
+                throw new NullPointerException(Messages.getString("security.07")); //$NON-NLS-1$
             }
             if (protectionParameter == null) {
-                throw new NullPointerException("protectionParameter is null");
+                throw new NullPointerException(Messages.getString("security.42")); //$NON-NLS-1$
             }
             return new BuilderImpl(null, protectionParameter, null,
                     type, provider, AccessController.getContext());
@@ -681,9 +678,7 @@
                         passwd = KeyStoreSpi
                                 .getPasswordFromCallBack(protParameter);
                     } else {
-                        throw new KeyStoreException(
-                                "ProtectionParameter object is not PasswordProtection "
-                                        + "and  CallbackHandlerProtection");
+                        throw new KeyStoreException(Messages.getString("security.35")); //$NON-NLS-1$
                     }
 
                     // load KeyStore from file
@@ -732,11 +727,10 @@
             public synchronized ProtectionParameter getProtectionParameter(
                     String alias) throws KeyStoreException {
                 if (alias == null) {
-                    throw new NullPointerException("alias is null");
+                    throw new NullPointerException(Messages.getString("security.3F")); //$NON-NLS-1$
                 }
                 if (!isGetKeyStore) {
-                    throw new IllegalStateException(
-                            "getKeyStore() was not invoked");
+                    throw new IllegalStateException(Messages.getString("security.46")); //$NON-NLS-1$
                 }
                 return protParameter;
             }
@@ -784,7 +778,7 @@
          */
         public CallbackHandlerProtection(CallbackHandler handler) {
             if (handler == null) {
-                throw new NullPointerException("handler is null");
+                throw new NullPointerException(Messages.getString("security.47")); //$NON-NLS-1$
             }
             this.callbackHandler = handler;
         }
@@ -844,7 +838,7 @@
          */
         public synchronized char[] getPassword() {
             if (password == null) {
-                throw new IllegalStateException("password was destroyed");
+                throw new IllegalStateException(Messages.getString("security.36")); //$NON-NLS-1$
             }
             return password;
         }
@@ -893,30 +887,27 @@
          */
         public PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain) {
             if (privateKey == null) {
-                throw new NullPointerException("privateKey is null");
+                throw new NullPointerException(Messages.getString("security.48")); //$NON-NLS-1$
             }
             if (chain == null) {
-                throw new NullPointerException("chain is null");
+                throw new NullPointerException(Messages.getString("security.49")); //$NON-NLS-1$
             }
 
             if (chain.length == 0) {
-                throw new IllegalArgumentException("chain length equals 0");
+                throw new IllegalArgumentException(Messages.getString("security.4A")); //$NON-NLS-1$
             }
             // Match algorithm of private key and algorithm of public key from
             // the end certificate
             String s = chain[0].getType();
             if (!(chain[0].getPublicKey().getAlgorithm()).equals(privateKey
                     .getAlgorithm())) {
-                throw new IllegalArgumentException(
-                        "Algorithm of private key does not "
-                                + "match algorithm of public key in end certificate of entry "
-                                + "(with index number: 0)");
+                throw new IllegalArgumentException(Messages.getString("security.4B")); //$NON-NLS-1$
             }
             // Match certificate types
             for (int i = 1; i < chain.length; i++) {
                 if (!s.equals(chain[i].getType())) {
                     throw new IllegalArgumentException(
-                            "Certificates from the given chain have different types");
+                            Messages.getString("security.4C")); //$NON-NLS-1$
                 }
             }
             // clone chain - this.chain = (Certificate[])chain.clone();
@@ -955,12 +946,12 @@
          */
         public String toString() {
             StringBuffer sb = new StringBuffer(
-                    "PrivateKeyEntry: number of elements in certificate chain is ");
+                    "PrivateKeyEntry: number of elements in certificate chain is "); //$NON-NLS-1$
             sb.append(Integer.toString(chain.length));
-            sb.append("\n");
+            sb.append("\n"); //$NON-NLS-1$
             for (int i = 0; i < chain.length; i++) {
                 sb.append(chain[i].toString());
-                sb.append("\n");
+                sb.append("\n"); //$NON-NLS-1$
             }
             return sb.toString();
         }
@@ -982,7 +973,7 @@
          */
         public SecretKeyEntry(SecretKey secretKey) {
             if (secretKey == null) {
-                throw new NullPointerException("secretKey is null");
+                throw new NullPointerException(Messages.getString("security.4D")); //$NON-NLS-1$
             }
             this.secretKey = secretKey;
         }
@@ -1000,7 +991,7 @@
          *  
          */
         public String toString() {
-            StringBuffer sb = new StringBuffer("SecretKeyEntry: algorithm - ");
+            StringBuffer sb = new StringBuffer("SecretKeyEntry: algorithm - "); //$NON-NLS-1$
             sb.append(secretKey.getAlgorithm());
             return sb.toString();
         }
@@ -1022,7 +1013,7 @@
          */
         public TrustedCertificateEntry(Certificate trustCertificate) {
             if (trustCertificate == null) {
-                throw new NullPointerException("trustCertificate is null");
+                throw new NullPointerException(Messages.getString("security.4E")); //$NON-NLS-1$
             }
             this.trustCertificate = trustCertificate;
         }
@@ -1040,7 +1031,7 @@
          *  
          */
         public String toString() {
-            return "TrustedCertificateEntry: \n".concat(trustCertificate
+            return "TrustedCertificateEntry: \n".concat(trustCertificate //$NON-NLS-1$
                     .toString());
         }
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStoreSpi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStoreSpi.java?view=diff&rev=450032&r1=450031&r2=450032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStoreSpi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStoreSpi.java Tue Sep 26 05:46:11 2006
@@ -27,6 +27,8 @@
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.PasswordCallback;
 
+import org.apache.harmony.security.internal.nls.Messages;
+
 public abstract class KeyStoreSpi {
 
     public abstract Key engineGetKey(String alias, char[] password)
@@ -67,7 +69,7 @@
 
     public void engineStore(KeyStore.LoadStoreParameter param)
             throws IOException, NoSuchAlgorithmException, CertificateException {
-        throw new UnsupportedOperationException("Not Supported operation");
+        throw new UnsupportedOperationException(Messages.getString("security.33")); //$NON-NLS-1$
     }
 
     public abstract void engineLoad(InputStream stream, char[] password)
@@ -83,7 +85,7 @@
         KeyStore.ProtectionParameter pp = param.getProtectionParameter();
         if (pp == null) {
             throw new IllegalArgumentException(
-                    "ProtectionParameter is not defined");
+                    Messages.getString("security.34")); //$NON-NLS-1$
         }
         if (pp instanceof KeyStore.PasswordProtection) {
             try {
@@ -104,7 +106,7 @@
             }
         }
         throw new UnsupportedOperationException(
-                "ProtectionParameter is neither PasswordProtection nor CallbackHandlerProtection");
+                Messages.getString("security.35")); //$NON-NLS-1$
     }
 
     public KeyStore.Entry engineGetEntry(String alias,
@@ -124,14 +126,14 @@
                     passW = ((KeyStore.PasswordProtection) protParam)
                             .getPassword();
                 } catch (IllegalStateException ee) {
-                    throw new KeyStoreException("Password was destroyed", ee);
+                    throw new KeyStoreException(Messages.getString("security.36"), ee); //$NON-NLS-1$
                 }
             } else if (protParam instanceof KeyStore.CallbackHandlerProtection) {
                 passW = getPasswordFromCallBack(protParam);
             } else {
                 throw new UnrecoverableEntryException(
-                        "ProtectionParameter object is not PasswordProtection: "
-                                + protParam.toString());
+                        Messages.getString("security.37", //$NON-NLS-1$
+                                protParam.toString()));
             }
         }
         if (engineIsKeyEntry(alias)) {
@@ -148,13 +150,13 @@
                 throw new KeyStoreException(e);
             }
         }
-        throw new NoSuchAlgorithmException("Unknown KeyStore.Entry object");
+        throw new NoSuchAlgorithmException(Messages.getString("security.38")); //$NON-NLS-1$
     }
 
     public void engineSetEntry(String alias, KeyStore.Entry entry,
             KeyStore.ProtectionParameter protParam) throws KeyStoreException {
         if (entry == null) {
-            throw new KeyStoreException("entry is null");
+            throw new KeyStoreException(Messages.getString("security.39")); //$NON-NLS-1$
         }
 
         if (engineContainsAlias(alias)) {
@@ -172,7 +174,7 @@
             try {
                 passW = ((KeyStore.PasswordProtection) protParam).getPassword();
             } catch (IllegalStateException ee) {
-                throw new KeyStoreException("Password was destroyed", ee);
+                throw new KeyStoreException(Messages.getString("security.36"), ee); //$NON-NLS-1$
             }
         } else {
             if (protParam instanceof KeyStore.CallbackHandlerProtection) {
@@ -183,7 +185,7 @@
                 }
             } else {
                 throw new KeyStoreException(
-                        "protParam should be PasswordProtection or CallbackHandlerProtection");
+                        Messages.getString("security.3A")); //$NON-NLS-1$
             }
         }
 
@@ -202,8 +204,7 @@
         }
 
         throw new KeyStoreException(
-                "Entry object is neither PrivateKeyObject nor SecretKeyEntry "
-                        + "nor TrustedCertificateEntry: " + entry.toString());
+                Messages.getString("security.3B", entry.toString())); //$NON-NLS-1$
     }
 
     public boolean engineEntryInstanceOf(String alias,
@@ -216,17 +217,17 @@
             if (engineIsCertificateEntry(alias)) {
                 return entryClass
                         .isAssignableFrom(Class
-                                .forName("java.security.KeyStore$TrustedCertificateEntry"));
+                                .forName("java.security.KeyStore$TrustedCertificateEntry")); //$NON-NLS-1$
             }
 
             if (engineIsKeyEntry(alias)) {
                 if (entryClass.isAssignableFrom(Class
-                        .forName("java.security.KeyStore$PrivateKeyEntry"))) {
+                        .forName("java.security.KeyStore$PrivateKeyEntry"))) { //$NON-NLS-1$
                     return engineGetCertificate(alias) != null;
                 }
 
                 if (entryClass.isAssignableFrom(Class
-                        .forName("java.security.KeyStore$SecretKeyEntry"))) {
+                        .forName("java.security.KeyStore$SecretKeyEntry"))) { //$NON-NLS-1$
                     return engineGetCertificate(alias) == null;
                 }
             }
@@ -249,21 +250,21 @@
 
         if (!(protParam instanceof KeyStore.CallbackHandlerProtection)) {
             throw new UnrecoverableEntryException(
-                    "Incorrect ProtectionParameter");
+                    Messages.getString("security.3C")); //$NON-NLS-1$
         }
 
         String clName = Security
-                .getProperty("auth.login.defaultCallbackHandler");
+                .getProperty("auth.login.defaultCallbackHandler"); //$NON-NLS-1$
         if (clName == null) {
             throw new UnrecoverableEntryException(
-                    "Default CallbackHandler was not defined");
+                    Messages.getString("security.3D")); //$NON-NLS-1$
 
         }
 
         try {
             Class<?> cl = Class.forName(clName);
             CallbackHandler cbHand = (CallbackHandler) cl.newInstance();
-            PasswordCallback[] pwCb = { new PasswordCallback("password: ", true) };
+            PasswordCallback[] pwCb = { new PasswordCallback("password: ", true) }; //$NON-NLS-1$
             cbHand.handle(pwCb);
             return pwCb[0].getPassword();
         } catch (Exception e) {



Mime
View raw message