harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r450013 - in /incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java: javax/crypto/ javax/crypto/spec/ org/apache/harmony/crypto/internal/ org/apache/harmony/crypto/internal/nls/ org/apache/harmony/crypto/utils/
Date Tue, 26 Sep 2006 12:13:48 GMT
Author: tellison
Date: Tue Sep 26 05:13:47 2006
New Revision: 450013

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

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/Cipher.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/CipherSpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/ExemptionMechanism.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/KeyAgreement.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/KeyGenerator.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/Mac.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/SealedObject.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/SecretKeyFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/internal/NullCipherSpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/internal/nls/messages.properties
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/Cipher.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/Cipher.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/Cipher.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/Cipher.java Tue Sep 26 05:13:47 2006
@@ -39,6 +39,7 @@
 import java.util.Set;
 import java.util.StringTokenizer;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
 import org.apache.harmony.security.fortress.Engine;
 
 
@@ -95,7 +96,7 @@
     /**
      * The service name.
      */
-    private static final String SERVICE = "Cipher";
+    private static final String SERVICE = "Cipher"; //$NON-NLS-1$
 
     /**
      * Used to access common engine functionality
@@ -148,13 +149,12 @@
             NoSuchProviderException, NoSuchPaddingException {
 
         if (provider == null) {
-            throw new IllegalArgumentException("provider is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.04")); //$NON-NLS-1$
         }
 
         Provider p = Security.getProvider(provider);
         if (p == null) {
-            throw new NoSuchProviderException("Provider " + provider
-                    + " is not available");
+            throw new NoSuchProviderException(Messages.getString("crypto.16", provider)); //$NON-NLS-1$
         }
         return getInstance(transformation, p);
     }
@@ -167,7 +167,7 @@
             Provider provider) throws NoSuchAlgorithmException,
             NoSuchPaddingException {
         if (provider == null) {
-            throw new IllegalArgumentException("provider is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.04")); //$NON-NLS-1$
         }
         Cipher c = getCipher(transformation, provider);
         return c;
@@ -185,9 +185,9 @@
     private static synchronized Cipher getCipher(String transformation, Provider provider)
             throws NoSuchAlgorithmException, NoSuchPaddingException {
 
-        if (transformation == null || "".equals(transformation)) {
-            throw new NoSuchAlgorithmException("Invalid transformation "
-                    + transformation);
+        if (transformation == null || "".equals(transformation)) { //$NON-NLS-1$
+            throw new NoSuchAlgorithmException(Messages.getString("crypto.17", //$NON-NLS-1$
+                    transformation));
         }
 
         String[] transf = checkTransformation(transformation);
@@ -202,9 +202,9 @@
             }
         } else {
             String[] searhOrder = {
-                    transf[0] + "/" + transf[1] + "/" + transf[2], // "algorithm/mode/padding"
-                    transf[0] + "/" + transf[1], // "algorithm/mode"
-                    transf[0] + "//" + transf[2], // "algorithm//padding"
+                    transf[0] + "/" + transf[1] + "/" + transf[2], // "algorithm/mode/padding" //$NON-NLS-1$ //$NON-NLS-2$
+                    transf[0] + "/" + transf[1], // "algorithm/mode" //$NON-NLS-1$
+                    transf[0] + "//" + transf[2], // "algorithm//padding" //$NON-NLS-1$
                     transf[0] // "algorithm"
             };
             int i;
@@ -255,29 +255,29 @@
         String[] transf = { null, null, null };
         StringTokenizer st;
         int i = 0;
-        for (st = new StringTokenizer(transformation, "/"); st
+        for (st = new StringTokenizer(transformation, "/"); st //$NON-NLS-1$
                 .hasMoreElements();) {
             if (i > 2) {
-                throw new NoSuchAlgorithmException("Invalid transformation "
-                        + transformation);
+                throw new NoSuchAlgorithmException(Messages.getString("crypto.17", //$NON-NLS-1$
+                        transformation));
             }
             transf[i] = st.nextToken();
             if (transf[i] != null) {
                 transf[i] = transf[i].trim();
-                if ("".equals(transf[i])) {
+                if ("".equals(transf[i])) { //$NON-NLS-1$
                     transf[i] = null;
                 }
                 i++;
             }
         }
         if (transf[0] == null) {
-            throw new NoSuchAlgorithmException("Invalid transformation "
-                    + transformation);
+            throw new NoSuchAlgorithmException(Messages.getString("crypto.17", //$NON-NLS-1$
+                    transformation));
         }
         if (!(transf[1] == null && transf[2] == null)
                 && (transf[1] == null || transf[2] == null)) {
-            throw new NoSuchAlgorithmException("Invalid transformation "
-                    + transformation);
+            throw new NoSuchAlgorithmException(Messages.getString("crypto.17", //$NON-NLS-1$
+                    transformation));
         }
         return transf;
     }
@@ -313,7 +313,7 @@
     public final int getOutputSize(int inputLen) {
         if (mode == 0) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized");
+                    Messages.getString("crypto.18")); //$NON-NLS-1$
         }
         return spiImpl.engineGetOutputSize(inputLen);
     }
@@ -371,7 +371,7 @@
             throws InvalidKeyException {
         if (opmode != ENCRYPT_MODE && opmode != DECRYPT_MODE
                 && opmode != UNWRAP_MODE && opmode != WRAP_MODE) {
-            throw new InvalidParameterException("Invalid mode");
+            throw new InvalidParameterException(Messages.getString("crypto.19")); //$NON-NLS-1$
         }
         //        FIXME InvalidKeyException
         //        if keysize exceeds the maximum allowable keysize
@@ -401,7 +401,7 @@
             InvalidAlgorithmParameterException {
         if (opmode != ENCRYPT_MODE && opmode != DECRYPT_MODE
                 && opmode != UNWRAP_MODE && opmode != WRAP_MODE) {
-            throw new InvalidParameterException("Invalid mode");
+            throw new InvalidParameterException(Messages.getString("crypto.19")); //$NON-NLS-1$
         }
         //        FIXME InvalidKeyException
         //        if keysize exceeds the maximum allowable keysize
@@ -434,7 +434,7 @@
             InvalidAlgorithmParameterException {
         if (opmode != ENCRYPT_MODE && opmode != DECRYPT_MODE
                 && opmode != UNWRAP_MODE && opmode != WRAP_MODE) {
-            throw new InvalidParameterException("Invalid mode");
+            throw new InvalidParameterException(Messages.getString("crypto.19")); //$NON-NLS-1$
         }
         //        FIXME InvalidKeyException
         //        if keysize exceeds the maximum allowable keysize
@@ -466,7 +466,7 @@
             SecureRandom random) throws InvalidKeyException {
         if (opmode != ENCRYPT_MODE && opmode != DECRYPT_MODE
                 && opmode != UNWRAP_MODE && opmode != WRAP_MODE) {
-            throw new InvalidParameterException("Invalid mode");
+            throw new InvalidParameterException(Messages.getString("crypto.19")); //$NON-NLS-1$
         }
         if (certificate instanceof X509Certificate) {
             Set ce = ((X509Certificate) certificate).getCriticalExtensionOIDs();
@@ -474,7 +474,7 @@
             if (ce != null && !ce.isEmpty()) {
                 for (Iterator i = ce.iterator(); i.hasNext();) {
                     String oid = (String) i.next();
-                    if (oid.equals("2.5.29.15")) { //KeyUsage OID = 2.5.29.15
+                    if (oid.equals("2.5.29.15")) { //KeyUsage OID = 2.5.29.15 //$NON-NLS-1$
                         critical = true;
                         break;
                     }
@@ -494,10 +494,10 @@
                     if (keyUsage != null) {
                         if (opmode == ENCRYPT_MODE && (!keyUsage[7])) {
                             throw new InvalidKeyException(
-                                    "The public key in the certificate cannot be used for ENCRYPT_MODE");
+                                    Messages.getString("crypto.1A")); //$NON-NLS-1$
                         } else if (opmode == DECRYPT_MODE && (!keyUsage[8])) {
                             throw new InvalidKeyException(
-                                    "The public key in the certificate cannot be used for DECRYPT_MODE");
+                                    Messages.getString("crypto.1B")); //$NON-NLS-1$
                         }
                     }
                 }
@@ -517,10 +517,10 @@
     public final byte[] update(byte[] input) {
         if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized properly");
+                    Messages.getString("crypto.1C")); //$NON-NLS-1$
         }
         if (input == null) {
-            throw new IllegalArgumentException("input parameter is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.1D")); //$NON-NLS-1$
         }
         if (input.length == 0) {
             return null;
@@ -535,16 +535,16 @@
     public final byte[] update(byte[] input, int inputOffset, int inputLen) {
         if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized properly");
+                    Messages.getString("crypto.1C")); //$NON-NLS-1$
         }
         if (input == null) {
-            throw new IllegalArgumentException("The input parameter is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.1D")); //$NON-NLS-1$
         }
         if (inputOffset < 0 || inputLen < 0
                 || inputLen > input.length 
                 || inputOffset > input.length - inputLen) {
             throw new IllegalArgumentException(
-                    "Incorrect inputOffset/inputLen parameters");
+                    Messages.getString("crypto.1E")); //$NON-NLS-1$
         }
         if (input.length == 0) {
             return null;
@@ -569,23 +569,23 @@
             byte[] output, int outputOffset) throws ShortBufferException {
         if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized properly");
+                    Messages.getString("crypto.1C")); //$NON-NLS-1$
         }
         if (input == null) {
-            throw new IllegalArgumentException("The input parameter is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.1D")); //$NON-NLS-1$
         }
         if (output == null) {
-            throw new IllegalArgumentException("The output parameter is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.1F")); //$NON-NLS-1$
         }
         if (outputOffset < 0) {
             throw new IllegalArgumentException(
-                    "Incorrect outputOffset parameter");
+                    Messages.getString("crypto.20")); //$NON-NLS-1$
         }
         if (inputOffset < 0 || inputLen < 0
                 || inputLen > input.length
                 || inputOffset > input.length - inputLen) {
             throw new IllegalArgumentException(
-                    "Incorrect inputOffset/inputLen parameters");
+                    Messages.getString("crypto.21")); //$NON-NLS-1$
         }
         if (input.length == 0) {
             return 0;
@@ -602,11 +602,11 @@
             throws ShortBufferException {
         if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized properly");
+                    Messages.getString("crypto.1C")); //$NON-NLS-1$
         }
         if (input == output) {
             throw new IllegalArgumentException(
-                    "Input and output are the same object");
+                    Messages.getString("crypto.22")); //$NON-NLS-1$
         }
         return spiImpl.engineUpdate(input, output);
     }
@@ -619,7 +619,7 @@
             BadPaddingException {
         if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized properly");
+                    Messages.getString("crypto.1C")); //$NON-NLS-1$
         }
         return spiImpl.engineDoFinal(null, 0, 0);
     }
@@ -633,11 +633,11 @@
             BadPaddingException {
         if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized properly");
+                    Messages.getString("crypto.1C")); //$NON-NLS-1$
         }
         if (outputOffset < 0) {
             throw new IllegalArgumentException(
-                    "Incorrect outputOffset parameter");
+                    Messages.getString("crypto.20")); //$NON-NLS-1$
         }
         return spiImpl.engineDoFinal(null, 0, 0, output, outputOffset);
     }
@@ -650,7 +650,7 @@
             BadPaddingException {
         if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized properly");
+                    Messages.getString("crypto.1C")); //$NON-NLS-1$
         }
         return spiImpl.engineDoFinal(input, 0, input.length);
     }
@@ -663,12 +663,12 @@
             throws IllegalBlockSizeException, BadPaddingException {
         if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized properly");
+                    Messages.getString("crypto.1C")); //$NON-NLS-1$
         }
         if (inputOffset < 0 || inputLen < 0
                 || inputOffset + inputLen > input.length) {
             throw new IllegalArgumentException(
-                    "Incorrect inputOffset/inputLen parameters");
+                    Messages.getString("crypto.1E")); //$NON-NLS-1$
         }
         return spiImpl.engineDoFinal(input, inputOffset, inputLen);
     }
@@ -692,12 +692,12 @@
             IllegalBlockSizeException, BadPaddingException {
         if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized properly");
+                    Messages.getString("crypto.1C")); //$NON-NLS-1$
         }
         if (inputOffset < 0 || inputLen < 0
                 || inputOffset + inputLen > input.length) {
             throw new IllegalArgumentException(
-                    "Incorrect inputOffset/inputLen parameters");
+                    Messages.getString("crypto.1E")); //$NON-NLS-1$
         }
         return spiImpl.engineDoFinal(input, inputOffset, inputLen, output,
                 outputOffset);
@@ -712,11 +712,11 @@
             BadPaddingException {
         if (mode != ENCRYPT_MODE && mode != DECRYPT_MODE) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized properly");
+                    Messages.getString("crypto.1C")); //$NON-NLS-1$
         }
         if (input == output) {
             throw new IllegalArgumentException(
-                    "Input and output are the same object");
+                    Messages.getString("crypto.2E")); //$NON-NLS-1$
         }
         return spiImpl.engineDoFinal(input, output);
     }
@@ -729,7 +729,7 @@
             InvalidKeyException {
         if (mode != WRAP_MODE) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized properly");
+                    Messages.getString("crypto.1C")); //$NON-NLS-1$
         }
         return spiImpl.engineWrap(key);
     }
@@ -743,7 +743,7 @@
             NoSuchAlgorithmException {
         if (mode != UNWRAP_MODE) {
             throw new IllegalStateException(
-                    "Cipher has not yet been initialized properly");
+                    Messages.getString("crypto.1C")); //$NON-NLS-1$
         }
         return spiImpl.engineUnwrap(wrappedKey, wrappedKeyAlgorithm,
                 wrappedKeyType);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/CipherSpi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/CipherSpi.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/CipherSpi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/CipherSpi.java Tue Sep 26 05:13:47 2006
@@ -30,6 +30,8 @@
 import java.security.spec.AlgorithmParameterSpec;
 import java.nio.ByteBuffer;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  * 
@@ -127,10 +129,10 @@
     protected int engineUpdate(ByteBuffer input, ByteBuffer output)
             throws ShortBufferException {
         if (input == null) {
-            throw new NullPointerException("input byte buffer is null");
+            throw new NullPointerException(Messages.getString("crypto.0C")); //$NON-NLS-1$
         }
         if (output == null) {
-            throw new NullPointerException("output byte buffer is null");
+            throw new NullPointerException(Messages.getString("crypto.0D")); //$NON-NLS-1$
         }
         int position = input.position();
         int limit = input.limit();
@@ -150,12 +152,12 @@
             bOutput = engineUpdate(bInput, 0, limit - position);
         }
         if (output.remaining() < bOutput.length) {
-            throw new ShortBufferException("Output is small");
+            throw new ShortBufferException(Messages.getString("crypto.0E")); //$NON-NLS-1$
         }
         try {
             output.put(bOutput);
         } catch (java.nio.BufferOverflowException e) {
-            throw new ShortBufferException("Output buffer is too small: " + e);
+            throw new ShortBufferException(Messages.getString("crypto.0F", e)); //$NON-NLS-1$
         }
         return bOutput.length;
     }
@@ -184,10 +186,10 @@
             throws ShortBufferException, IllegalBlockSizeException,
             BadPaddingException {
         if (input == null) {
-            throw new NullPointerException("input byte buffer is null");
+            throw new NullPointerException(Messages.getString("crypto.0C")); //$NON-NLS-1$
         }
         if (output == null) {
-            throw new NullPointerException("output byte buffer is null");
+            throw new NullPointerException(Messages.getString("crypto.0D")); //$NON-NLS-1$
         }
         int position = input.position();
         int limit = input.limit();
@@ -209,12 +211,12 @@
             bOutput = engineDoFinal(bInput, 0, limit - position);
         }
         if (output.remaining() < bOutput.length) {
-            throw new ShortBufferException("Output is small");
+            throw new ShortBufferException(Messages.getString("crypto.0E")); //$NON-NLS-1$
         }
         try {
             output.put(bOutput);
         } catch (java.nio.BufferOverflowException e) {
-            throw new ShortBufferException("Output buffer is too small: " + e);
+            throw new ShortBufferException(Messages.getString("crypto.0F", e)); //$NON-NLS-1$
         }
         return bOutput.length;
     }
@@ -226,7 +228,7 @@
     protected byte[] engineWrap(Key key) throws IllegalBlockSizeException,
             InvalidKeyException {
         throw new UnsupportedOperationException(
-                "engineWrap(Key key) is not supported");
+                Messages.getString("crypto.10")); //$NON-NLS-1$
     }
 
     /**
@@ -237,7 +239,7 @@
             int wrappedKeyType) throws InvalidKeyException,
             NoSuchAlgorithmException {
         throw new UnsupportedOperationException(
-                "engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) is not supported");
+                Messages.getString("crypto.11")); //$NON-NLS-1$
     }
 
     /**
@@ -246,6 +248,6 @@
      */
     protected int engineGetKeySize(Key key) throws InvalidKeyException {
         throw new UnsupportedOperationException(
-                "engineGetKeySize(Key key) is not supported");
+                Messages.getString("crypto.12")); //$NON-NLS-1$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java Tue Sep 26 05:13:47 2006
@@ -32,6 +32,7 @@
 import java.security.spec.InvalidKeySpecException;
 import java.security.spec.PKCS8EncodedKeySpec;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
 import org.apache.harmony.crypto.utils.AlgNameMapper;
 import org.apache.harmony.security.asn1.ASN1Any;
 import org.apache.harmony.security.asn1.ASN1Implicit;
@@ -64,7 +65,7 @@
     public EncryptedPrivateKeyInfo(byte[] encoded)
             throws IOException {
         if (encoded == null) {
-            throw new NullPointerException("the encoded parameter is null");
+            throw new NullPointerException(Messages.getString("crypto.22")); //$NON-NLS-1$
         }
         this.encoded = new byte[encoded.length];
         System.arraycopy(encoded, 0, this.encoded, 0, encoded.length);
@@ -107,18 +108,18 @@
     public EncryptedPrivateKeyInfo(String encrAlgName, byte[] encryptedData)
         throws NoSuchAlgorithmException {
         if (encrAlgName == null) {
-            throw new NullPointerException("the algName parameter is null");
+            throw new NullPointerException(Messages.getString("crypto.23")); //$NON-NLS-1$
         }
         this.algName = encrAlgName;
         if (!mapAlgName()) {
-            throw new NoSuchAlgorithmException(this.algName + " not supported");
+            throw new NoSuchAlgorithmException(Messages.getString("crypto.24", this.algName)); //$NON-NLS-1$
         }
         if (encryptedData == null) {
             throw new NullPointerException(
-                    "the encryptedData parameter is null");
+                    Messages.getString("crypto.25")); //$NON-NLS-1$
         }
         if (encryptedData.length == 0) {
-            throw new IllegalArgumentException("the encryptedData is empty");
+            throw new IllegalArgumentException(Messages.getString("crypto.26")); //$NON-NLS-1$
         }
         this.encryptedData = new byte[encryptedData.length];
         System.arraycopy(encryptedData, 0,
@@ -133,22 +134,22 @@
             byte[] encryptedData)
         throws NoSuchAlgorithmException {
         if (algParams == null) {
-            throw new NullPointerException("the algParams parameter is null");
+            throw new NullPointerException(Messages.getString("crypto.27")); //$NON-NLS-1$
         }
         this.algParameters = algParams;
         if (encryptedData == null) {
             throw new NullPointerException(
-                    "the encryptedData parameter is null");
+                    Messages.getString("crypto.25")); //$NON-NLS-1$
         }
         if (encryptedData.length == 0) {
-            throw new IllegalArgumentException("the encryptedData is empty");
+            throw new IllegalArgumentException(Messages.getString("crypto.26")); //$NON-NLS-1$
         }
         this.encryptedData = new byte[encryptedData.length];
         System.arraycopy(encryptedData, 0,
                 this.encryptedData, 0, encryptedData.length);
         this.algName = this.algParameters.getAlgorithm();
         if (!mapAlgName()) {
-            throw new NoSuchAlgorithmException(this.algName + " not supported");
+            throw new NoSuchAlgorithmException(Messages.getString("crypto.24", this.algName)); //$NON-NLS-1$
         }
     }
 
@@ -181,7 +182,7 @@
     public PKCS8EncodedKeySpec getKeySpec(Cipher cipher)
         throws InvalidKeySpecException {
         if (cipher == null) {
-            throw new NullPointerException("the cipher parameter is null");
+            throw new NullPointerException(Messages.getString("crypto.28")); //$NON-NLS-1$
         }
         try {
             byte[] decryptedData = cipher.doFinal(encryptedData);
@@ -189,7 +190,7 @@
                 ASN1PrivateKeyInfo.verify(decryptedData);
             } catch (IOException e1) {
                 throw new InvalidKeySpecException(
-                        "Decrypted data does not represent valid PKCS#8 PrivateKeyInfo");
+                        Messages.getString("crypto.29")); //$NON-NLS-1$
             }
             return new PKCS8EncodedKeySpec(decryptedData);
         } catch (IllegalStateException e) {
@@ -208,7 +209,7 @@
         throws NoSuchAlgorithmException,
                InvalidKeyException {
         if (decryptKey == null) {
-            throw new NullPointerException("the decryptKey parameter is null");
+            throw new NullPointerException(Messages.getString("crypto.2A")); //$NON-NLS-1$
         }
         try {
             Cipher cipher = Cipher.getInstance(algName);
@@ -222,7 +223,7 @@
                 ASN1PrivateKeyInfo.verify(decryptedData);
             } catch (IOException e1) {
                 throw new InvalidKeyException(
-                        "Decrypted data does not represent valid PKCS#8 PrivateKeyInfo");
+                        Messages.getString("crypto.29")); //$NON-NLS-1$
             }
             return new PKCS8EncodedKeySpec(decryptedData);
         } catch (NoSuchPaddingException e) {
@@ -246,11 +247,11 @@
                NoSuchAlgorithmException,
                InvalidKeyException {
         if (decryptKey == null) {
-            throw new NullPointerException("the decryptKey parameter is null");
+            throw new NullPointerException(Messages.getString("crypto.2A")); //$NON-NLS-1$
         }
         if (providerName == null) {
             throw new NullPointerException(
-                    "the providerName parameter is null");
+                    Messages.getString("crypto.2B")); //$NON-NLS-1$
         }
         try {
             Cipher cipher = Cipher.getInstance(algName, providerName);
@@ -264,7 +265,7 @@
                 ASN1PrivateKeyInfo.verify(decryptedData);
             } catch (IOException e1) {
                 throw new InvalidKeyException(
-                        "Decrypted data does not represent valid PKCS#8 PrivateKeyInfo");
+                        Messages.getString("crypto.29")); //$NON-NLS-1$
             }
             return new PKCS8EncodedKeySpec(decryptedData);
         } catch (NoSuchPaddingException e) {
@@ -287,10 +288,10 @@
         throws NoSuchAlgorithmException,
                InvalidKeyException {
         if (decryptKey == null) {
-            throw new NullPointerException("the decryptKey parameter is null");
+            throw new NullPointerException(Messages.getString("crypto.2A")); //$NON-NLS-1$
         }
         if (provider == null) {
-            throw new NullPointerException("the provider parameter is null");
+            throw new NullPointerException(Messages.getString("crypto.2C")); //$NON-NLS-1$
         }
         try {
             Cipher cipher = Cipher.getInstance(algName, provider);
@@ -304,7 +305,7 @@
                 ASN1PrivateKeyInfo.verify(decryptedData);
             } catch (IOException e1) {
                 throw new InvalidKeyException(
-                        "Decrypted data does not represent valid PKCS#8 PrivateKeyInfo");
+                        Messages.getString("crypto.29")); //$NON-NLS-1$
             }
             return new PKCS8EncodedKeySpec(decryptedData);
         } catch (NoSuchPaddingException e) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/ExemptionMechanism.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/ExemptionMechanism.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/ExemptionMechanism.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/ExemptionMechanism.java Tue Sep 26 05:13:47 2006
@@ -27,18 +27,19 @@
 import java.security.spec.AlgorithmParameterSpec;
 import java.util.Arrays;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
 import org.apache.harmony.security.fortress.Engine;
 
 public class ExemptionMechanism {
 
     // Store spi implementation service name
-    private static final String SERVICE = "ExemptionMechanism";
+    private static final String SERVICE = "ExemptionMechanism"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
 
     // Warning for reporting about not initializes ExemptionMechanism
-    private static final String NOTINITEMECH = "ExemptionMechanism is not initialized";
+    private static final String NOTINITEMECH = Messages.getString("crypto.2D"); //$NON-NLS-1$
 
     // Store used provider
     private final Provider provider;
@@ -73,7 +74,7 @@
     public static final ExemptionMechanism getInstance(String algorithm)
             throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, null);
@@ -86,14 +87,14 @@
             String provider) throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.04")); //$NON-NLS-1$
         }
         Provider impProvider = Security.getProvider(provider);
         if (impProvider == null) {
             throw new NoSuchProviderException(provider);
         }
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
         return getInstance(algorithm, impProvider);
     }
@@ -101,10 +102,10 @@
     public static final ExemptionMechanism getInstance(String algorithm,
             Provider provider) throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
         if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.04")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, provider, null);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/KeyAgreement.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/KeyAgreement.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/KeyAgreement.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/KeyAgreement.java Tue Sep 26 05:13:47 2006
@@ -31,6 +31,7 @@
 import java.security.Security;
 import java.security.spec.AlgorithmParameterSpec;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
 import org.apache.harmony.security.fortress.Engine;
 
 
@@ -42,7 +43,7 @@
 public class KeyAgreement {
 
     // Store spi implementation service name
-    private static final String SERVICE = "KeyAgreement";
+    private static final String SERVICE = "KeyAgreement"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
@@ -93,7 +94,7 @@
     public static final KeyAgreement getInstance(String algorithm)
             throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, null);
@@ -110,7 +111,7 @@
             String provider) throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException("Provider is null or empty");
+            throw new IllegalArgumentException(Messages.getString("crypto.03")); //$NON-NLS-1$
         }
         Provider impProvider = Security.getProvider(provider);
         if (impProvider == null) {
@@ -126,10 +127,10 @@
     public static final KeyAgreement getInstance(String algorithm,
             Provider provider) throws NoSuchAlgorithmException {
         if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.04")); //$NON-NLS-1$
         }
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, provider, null);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/KeyGenerator.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/KeyGenerator.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/KeyGenerator.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/KeyGenerator.java Tue Sep 26 05:13:47 2006
@@ -29,6 +29,7 @@
 import java.security.Security;
 import java.security.spec.AlgorithmParameterSpec;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
 import org.apache.harmony.security.fortress.Engine;
 
 
@@ -40,7 +41,7 @@
 public class KeyGenerator {
 
     // Store spi implementation service name
-    private static final String SERVICE = "KeyGenerator";
+    private static final String SERVICE = "KeyGenerator"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
@@ -91,7 +92,7 @@
     public static final KeyGenerator getInstance(String algorithm)
             throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, null);
@@ -108,7 +109,7 @@
             String provider) throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException("Provider is null or empty");
+            throw new IllegalArgumentException(Messages.getString("crypto.03")); //$NON-NLS-1$
         }
         Provider impProvider = Security.getProvider(provider);
         if (impProvider == null) {
@@ -124,10 +125,10 @@
     public static final KeyGenerator getInstance(String algorithm,
             Provider provider) throws NoSuchAlgorithmException {
         if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.04")); //$NON-NLS-1$
         }
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, provider, null);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/Mac.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/Mac.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/Mac.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/Mac.java Tue Sep 26 05:13:47 2006
@@ -31,6 +31,7 @@
 import java.security.Security;
 import java.security.spec.AlgorithmParameterSpec;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
 import org.apache.harmony.security.fortress.Engine;
 
 
@@ -42,13 +43,13 @@
 public class Mac implements Cloneable {
 
     // Store spi implementation service name
-    private static final String SERVICE = "Mac";
+    private static final String SERVICE = "Mac"; //$NON-NLS-1$
 
     //Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
 
     // Warning for reporting about not initialized Mac
-    private static final String NOTINITMAC = "MAC was not initialized";
+    private static final String NOTINITMAC = Messages.getString("crypto.01"); //$NON-NLS-1$
 
     // Store used provider
     private final Provider provider;
@@ -98,7 +99,7 @@
     public static final Mac getInstance(String algorithm)
             throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("algorithm is null");
+            throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, null);
@@ -115,7 +116,7 @@
     public static final Mac getInstance(String algorithm, String provider)
             throws NoSuchAlgorithmException, NoSuchProviderException {
         if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException("Provider is null or empty");
+            throw new IllegalArgumentException(Messages.getString("crypto.03")); //$NON-NLS-1$
         }
         Provider impProvider = Security.getProvider(provider);
         if (impProvider == null) {
@@ -133,10 +134,10 @@
     public static final Mac getInstance(String algorithm, Provider provider)
             throws NoSuchAlgorithmException {
         if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.04")); //$NON-NLS-1$
         }
         if (algorithm == null) {
-            throw new NullPointerException("algorithm is null");
+            throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, provider, null);
@@ -159,7 +160,7 @@
     public final void init(Key key, AlgorithmParameterSpec params)
             throws InvalidKeyException, InvalidAlgorithmParameterException {
         if (key == null) {
-            throw new InvalidKeyException("key is null");
+            throw new InvalidKeyException(Messages.getString("crypto.05")); //$NON-NLS-1$
         }
         spiImpl.engineInit(key, params);
         isInitMac = true;
@@ -171,7 +172,7 @@
      */
     public final void init(Key key) throws InvalidKeyException {
         if (key == null) {
-            throw new InvalidKeyException("key is null");
+            throw new InvalidKeyException(Messages.getString("crypto.05")); //$NON-NLS-1$
         }
         try {
             spiImpl.engineInit(key, null);
@@ -205,7 +206,7 @@
             return;
         }
         if ((offset < 0) || (len < 0) || ((offset + len) > input.length)) {
-            throw new IllegalArgumentException("Incorrect arguments");
+            throw new IllegalArgumentException(Messages.getString("crypto.06")); //$NON-NLS-1$
         }
         spiImpl.engineUpdate(input, offset, len);
     }
@@ -234,7 +235,7 @@
         if (input != null) {
             spiImpl.engineUpdate(input);
         } else {
-            throw new IllegalArgumentException("input is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.07")); //$NON-NLS-1$
         }
     }
 
@@ -259,17 +260,17 @@
             throw new IllegalStateException(NOTINITMAC);
         }
         if (output == null) {
-            throw new ShortBufferException("Output buffer is null");
+            throw new ShortBufferException(Messages.getString("crypto.08")); //$NON-NLS-1$
         }
         if ((outOffset < 0) || (outOffset >= output.length)) {
-            throw new ShortBufferException("Incorrect outOffset parameter: "
-                    + Integer.toString(outOffset));
+            throw new ShortBufferException(Messages.getString("crypto.09", //$NON-NLS-1$
+                    Integer.toString(outOffset)));
         }
         int t = spiImpl.engineGetMacLength();
         if (t > (output.length - outOffset)) {
             throw new ShortBufferException(
-                    "Output buffer is short. It is needed "
-                            + Integer.toString(t) + " bytes");
+                    Messages.getString("crypto.0A", //$NON-NLS-1$
+                            Integer.toString(t))); 
         }
         byte[] result = spiImpl.engineDoFinal();
         System.arraycopy(result, 0, output, outOffset, result.length);
@@ -282,7 +283,7 @@
      */
     public final byte[] doFinal(byte[] input) throws IllegalStateException {
         if (!isInitMac) {
-            throw new IllegalStateException("Not initialized Mac");
+            throw new IllegalStateException(Messages.getString("crypto.0B")); //$NON-NLS-1$
         }
         if (input != null) {
             spiImpl.engineUpdate(input, 0, input.length);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/SealedObject.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/SealedObject.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/SealedObject.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/SealedObject.java Tue Sep 26 05:13:47 2006
@@ -36,6 +36,8 @@
 import javax.crypto.IllegalBlockSizeException;
 import javax.crypto.NoSuchPaddingException;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -69,7 +71,7 @@
     public SealedObject(Serializable object, Cipher c)
                 throws IOException, IllegalBlockSizeException {
         if (c == null) {
-            throw new NullPointerException("Cipher is null!");
+            throw new NullPointerException(Messages.getString("crypto.13")); //$NON-NLS-1$
         }
         try {
             ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -93,7 +95,7 @@
      */
     protected SealedObject(SealedObject so) {
         if (so == null) {
-            throw new NullPointerException("Specified sealed object is null!");
+            throw new NullPointerException(Messages.getString("crypto.14")); //$NON-NLS-1$
         }
         this.encryptedContent = so.encryptedContent;
         this.encodedParams = so.encodedParams;
@@ -158,7 +160,7 @@
                 throws IOException, ClassNotFoundException,
                        IllegalBlockSizeException, BadPaddingException {
         if (c == null) {
-            throw new NullPointerException("Cipher is null.");
+            throw new NullPointerException(Messages.getString("crypto.13")); //$NON-NLS-1$
         }
         byte[] serialized = c.doFinal(encryptedContent);
         ObjectInputStream ois =
@@ -176,7 +178,7 @@
                        InvalidKeyException {
         if ((provider == null) || (provider.length() == 0)) {
             throw new IllegalArgumentException(
-                    "The provider name is empty or null");
+                    Messages.getString("crypto.15")); //$NON-NLS-1$
         }
         try {
             Cipher cipher = Cipher.getInstance(sealAlg, provider);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/SecretKeyFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/SecretKeyFactory.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/SecretKeyFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/SecretKeyFactory.java Tue Sep 26 05:13:47 2006
@@ -29,6 +29,7 @@
 import java.security.spec.InvalidKeySpecException;
 import java.security.spec.KeySpec;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
 import org.apache.harmony.security.fortress.Engine;
 
 
@@ -39,7 +40,7 @@
 public class SecretKeyFactory {
 
     // Store spi implementation service name
-    private static final String SERVICE = "SecretKeyFactory";
+    private static final String SERVICE = "SecretKeyFactory"; //$NON-NLS-1$
 
     // Used to access common engine functionality
     private static Engine engine = new Engine(SERVICE);
@@ -87,7 +88,7 @@
     public static final SecretKeyFactory getInstance(String algorithm)
             throws NoSuchAlgorithmException {
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, null);
@@ -104,7 +105,7 @@
             String provider) throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if ((provider == null) || (provider.length() == 0)) {
-            throw new IllegalArgumentException("Provider is null or empty");
+            throw new IllegalArgumentException(Messages.getString("crypto.03")); //$NON-NLS-1$
         }
         Provider impProvider = Security.getProvider(provider);
         if (impProvider == null) {
@@ -120,10 +121,10 @@
     public static final SecretKeyFactory getInstance(String algorithm,
             Provider provider) throws NoSuchAlgorithmException {
         if (provider == null) {
-            throw new IllegalArgumentException("Provider is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.04")); //$NON-NLS-1$
         }
         if (algorithm == null) {
-            throw new NullPointerException("Algorithm is null");
+            throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
         synchronized (engine) {
             engine.getInstance(algorithm, provider, null);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java Tue Sep 26 05:13:47 2006
@@ -19,6 +19,8 @@
 import java.security.InvalidKeyException;
 import java.security.spec.KeySpec;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -101,11 +103,11 @@
     public DESKeySpec(byte[] key, int offset)
                 throws InvalidKeyException {
         if (key == null) {
-            throw new NullPointerException("Key material is null.");
+            throw new NullPointerException(Messages.getString("crypto.2F")); //$NON-NLS-1$
         }
         if (key.length - offset < DES_KEY_LEN) {
             throw new InvalidKeyException(
-                    "The key material is shorter than 8 bytes");
+                    Messages.getString("crypto.40")); //$NON-NLS-1$
         }
         this.key = new byte[DES_KEY_LEN];
         System.arraycopy(key, offset, this.key, 0, DES_KEY_LEN);
@@ -126,11 +128,11 @@
     public static boolean isParityAdjusted(byte[] key, int offset)
             throws InvalidKeyException {
         if (key == null) {
-            throw new InvalidKeyException("Key material is null.");
+            throw new InvalidKeyException(Messages.getString("crypto.2F")); //$NON-NLS-1$
         }
         if (key.length - offset < DES_KEY_LEN) {
             throw new InvalidKeyException(
-                    "The key material is shorter than 8 bytes");
+                    Messages.getString("crypto.40")); //$NON-NLS-1$
         }
 
         int byteKey = 0;
@@ -155,11 +157,11 @@
     public static boolean isWeak(byte[] key, int offset)
               throws InvalidKeyException {
         if (key == null) {
-            throw new InvalidKeyException("Key material is null.");
+            throw new InvalidKeyException(Messages.getString("crypto.2F")); //$NON-NLS-1$
         }
         if (key.length - offset < DES_KEY_LEN) {
             throw new InvalidKeyException(
-                    "The key material is shorter than 8 bytes");
+                    Messages.getString("crypto.40")); //$NON-NLS-1$
         }
         I:
         for (int i=0; i<SEMIWEAKS.length; i++) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java Tue Sep 26 05:13:47 2006
@@ -23,6 +23,8 @@
 import java.security.InvalidKeyException;
 import java.security.spec.KeySpec;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -41,11 +43,11 @@
     public DESedeKeySpec(byte[] key)
                 throws InvalidKeyException {
         if (key == null) {
-            throw new NullPointerException("Specified key material is null.");
+            throw new NullPointerException(Messages.getString("crypto.2F")); //$NON-NLS-1$
         }
         if (key.length < DES_EDE_KEY_LEN) {
             throw new InvalidKeyException(
-                    "The key material is shorter than 24 bytes.");
+                    Messages.getString("crypto.30")); //$NON-NLS-1$
         }
         this.key = new byte[DES_EDE_KEY_LEN];
         System.arraycopy(key, 0, this.key, 0, DES_EDE_KEY_LEN);
@@ -57,11 +59,11 @@
     public DESedeKeySpec(byte[] key, int offset)
                 throws InvalidKeyException {
         if (key == null) {
-            throw new NullPointerException("Specified key material is null.");
+            throw new NullPointerException(Messages.getString("crypto.2F")); //$NON-NLS-1$
         }
         if (key.length - offset < DES_EDE_KEY_LEN) {
             throw new InvalidKeyException(
-                    "The key material is shorter than 24 bytes.");
+                    Messages.getString("crypto.30")); //$NON-NLS-1$
         }
         this.key = new byte[DES_EDE_KEY_LEN];
         System.arraycopy(key, offset, this.key, 0, DES_EDE_KEY_LEN);
@@ -83,7 +85,7 @@
                 throws InvalidKeyException {
         if (key.length - offset < DES_EDE_KEY_LEN) {
             throw new InvalidKeyException(
-                    "The key material is shorter than 24 bytes.");
+                    Messages.getString("crypto.30")); //$NON-NLS-1$
         }
         for (int i=offset; i<DES_EDE_KEY_LEN+offset; i++) {
             int b = key[i];

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java Tue Sep 26 05:13:47 2006
@@ -22,6 +22,8 @@
 
 import java.security.spec.AlgorithmParameterSpec;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -34,7 +36,7 @@
      */
     public IvParameterSpec(byte[] iv) {
         if (iv == null) {
-            throw new NullPointerException("Specified IV is null.");
+            throw new NullPointerException(Messages.getString("crypto.38")); //$NON-NLS-1$
         }
         this.iv = new byte[iv.length];
         System.arraycopy(iv, 0, this.iv, 0, iv.length);
@@ -46,10 +48,10 @@
     public IvParameterSpec(byte[] iv, int offset, int len) {
         if ((iv == null) || (iv.length - offset < len)) {
             throw new IllegalArgumentException(
-                    "iv is null or (iv.length - offset < len)");
+                    Messages.getString("crypto.39")); //$NON-NLS-1$
         }
         if (offset < 0 || len < 0) {
-            throw new ArrayIndexOutOfBoundsException("offset < 0 or len < 0");
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("crypto.3A")); //$NON-NLS-1$
         }
         this.iv = new byte[len];
         System.arraycopy(iv, offset, this.iv, 0, len);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java Tue Sep 26 05:13:47 2006
@@ -41,8 +41,8 @@
     public static final OAEPParameterSpec DEFAULT = new OAEPParameterSpec();
 
     private OAEPParameterSpec() {
-        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.pSrc = PSource.PSpecified.DEFAULT;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java Tue Sep 26 05:13:47 2006
@@ -24,6 +24,8 @@
 import java.security.spec.KeySpec;
 import java.util.Arrays;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -55,17 +57,17 @@
     public PBEKeySpec(char[] password, byte[] salt, int iterationCount,
                       int keyLength) {
         if (salt == null) {
-            throw new NullPointerException("Salt is null.");
+            throw new NullPointerException(Messages.getString("crypto.3B")); //$NON-NLS-1$
         }
         if (salt.length == 0) {
-            throw new IllegalArgumentException("salt is empty");
+            throw new IllegalArgumentException(Messages.getString("crypto.3C")); //$NON-NLS-1$
         }
         if (iterationCount <= 0) {
             throw new IllegalArgumentException(
-                    "iterationCount is not positive.");
+                    Messages.getString("crypto.3D")); //$NON-NLS-1$
         }
         if (keyLength <= 0) {
-            throw new IllegalArgumentException("keyLength is not positive.");
+            throw new IllegalArgumentException(Messages.getString("crypto.3E")); //$NON-NLS-1$
         }
 
         if (password == null) {
@@ -85,14 +87,14 @@
      */
     public PBEKeySpec(char[] password, byte[] salt, int iterationCount) {
         if (salt == null) {
-            throw new NullPointerException("Salt is null.");
+            throw new NullPointerException(Messages.getString("crypto.3B")); //$NON-NLS-1$
         }
         if (salt.length == 0) {
-            throw new IllegalArgumentException("salt is empty");
+            throw new IllegalArgumentException(Messages.getString("crypto.3C")); //$NON-NLS-1$
         }
         if (iterationCount <= 0) {
             throw new IllegalArgumentException(
-                    "iterationCount is not positive.");
+                    Messages.getString("crypto.3D")); //$NON-NLS-1$
         }
 
         if (password == null) {
@@ -120,7 +122,7 @@
      */
     public final char[] getPassword() {
         if (password == null) {
-            throw new IllegalStateException("The password has been cleared.");
+            throw new IllegalStateException(Messages.getString("crypto.3F")); //$NON-NLS-1$
         }
         char[] result = new char[password.length];
         System.arraycopy(password, 0, result, 0, password.length);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java Tue Sep 26 05:13:47 2006
@@ -23,6 +23,8 @@
 
 import java.security.spec.AlgorithmParameterSpec;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -36,7 +38,7 @@
      */
     public PBEParameterSpec(byte[] salt, int iterationCount) {
         if (salt == null) {
-            throw new NullPointerException("Specified salt is null.");
+            throw new NullPointerException(Messages.getString("crypto.3B")); //$NON-NLS-1$
         }
         this.salt = new byte[salt.length];
         System.arraycopy(salt, 0, this.salt, 0, salt.length);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/PSource.java Tue Sep 26 05:13:47 2006
@@ -21,6 +21,8 @@
 
 package javax.crypto.spec;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -35,7 +37,7 @@
      */
     protected PSource(String pSrcName) {
         if (pSrcName == null) {
-            throw new NullPointerException("pSrcName is null!");
+            throw new NullPointerException(Messages.getString("crypto.42")); //$NON-NLS-1$
         }
         this.pSrcName = pSrcName;
     }
@@ -60,7 +62,7 @@
         public static final PSpecified DEFAULT = new PSpecified();
 
         private PSpecified() {
-            super("PSpecified");
+            super("PSpecified"); //$NON-NLS-1$
             p = new byte[0];
         }
 
@@ -68,9 +70,9 @@
          * @com.intel.drl.spec_ref
          */
         public PSpecified(byte[] p) {
-            super("PSpecified");
+            super("PSpecified"); //$NON-NLS-1$
             if (p == null) {
-                throw new NullPointerException("encoding input is null!");
+                throw new NullPointerException(Messages.getString("crypto.43")); //$NON-NLS-1$
             }
             //TODO: It is unknown which name should be used!
             //super("");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java Tue Sep 26 05:13:47 2006
@@ -24,6 +24,8 @@
 import java.security.spec.AlgorithmParameterSpec;
 import java.util.Arrays;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -45,10 +47,10 @@
      */
     public RC2ParameterSpec(int effectiveKeyBits, byte[] iv) {
         if (iv == null) {
-            throw new IllegalArgumentException("iv is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.31")); //$NON-NLS-1$
         }
         if (iv.length < 8) {
-            throw new IllegalArgumentException("iv is shorter than 8 bytes");
+            throw new IllegalArgumentException(Messages.getString("crypto.41")); //$NON-NLS-1$
         }
         this.effectiveKeyBits = effectiveKeyBits;
         this.iv = new byte[8];
@@ -60,10 +62,10 @@
      */
     public RC2ParameterSpec(int effectiveKeyBits, byte[] iv, int offset) {
         if (iv == null) {
-            throw new IllegalArgumentException("iv is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.31")); //$NON-NLS-1$
         }
         if (iv.length - offset < 8) {
-            throw new IllegalArgumentException("iv is shorter than 8 bytes");
+            throw new IllegalArgumentException(Messages.getString("crypto.41")); //$NON-NLS-1$
         }
         this.effectiveKeyBits = effectiveKeyBits;
         this.iv = new byte[8];

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java Tue Sep 26 05:13:47 2006
@@ -24,6 +24,8 @@
 import java.security.spec.AlgorithmParameterSpec;
 import java.util.Arrays;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -49,11 +51,11 @@
      */
     public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv) {
         if (iv == null) {
-            throw new IllegalArgumentException("iv is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.31")); //$NON-NLS-1$
         }
         if (iv.length < 2 * (wordSize / 8)) {
             throw new IllegalArgumentException(
-                    "iv.length < 2 * (wordSize / 8)");
+                    Messages.getString("crypto.32")); //$NON-NLS-1$
         }
         this.version = version;
         this.rounds = rounds;
@@ -68,14 +70,14 @@
     public RC5ParameterSpec(int version, int rounds,
                                 int wordSize, byte[] iv, int offset) {
         if (iv == null) {
-            throw new IllegalArgumentException("iv is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.31")); //$NON-NLS-1$
         }
         if (offset < 0) {
-            throw new ArrayIndexOutOfBoundsException("offset is negative");
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("crypto.33")); //$NON-NLS-1$
         }
         if (iv.length - offset < 2 * (wordSize / 8)) {
             throw new IllegalArgumentException(
-                    "iv.length - offset < 2 * (wordSize / 8)");
+                    Messages.getString("crypto.34")); //$NON-NLS-1$
         }
         this.version = version;
         this.rounds = rounds;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java Tue Sep 26 05:13:47 2006
@@ -26,6 +26,8 @@
 import java.util.Arrays;
 import javax.crypto.SecretKey;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
+
 /**
  * @com.intel.drl.spec_ref
  */
@@ -38,20 +40,20 @@
 
     private final byte[] key;
     private final String algorithm;
-    private final String format = "RAW";
+    private final String format = "RAW"; //$NON-NLS-1$
 
     /**
      * @com.intel.drl.spec_ref
      */
     public SecretKeySpec(byte[] key, String algorithm) {
     	if (key == null) {
-    		throw new IllegalArgumentException("key is null");
+    		throw new IllegalArgumentException(Messages.getString("crypto.05")); //$NON-NLS-1$
     	}
     	if (key.length == 0) {
-    		throw new IllegalArgumentException("key is empty");
+    		throw new IllegalArgumentException(Messages.getString("crypto.35")); //$NON-NLS-1$
     	}
         if (algorithm == null) {
-            throw new IllegalArgumentException("algorithm is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
 
         this.algorithm = algorithm;
@@ -64,19 +66,19 @@
      */
     public SecretKeySpec(byte[] key, int offset, int len, String algorithm) {
     	if (key == null) {
-    		throw new IllegalArgumentException("key is null");
+    		throw new IllegalArgumentException(Messages.getString("crypto.05")); //$NON-NLS-1$
     	}
     	if (key.length == 0) {
-    		throw new IllegalArgumentException("key is empty");
+    		throw new IllegalArgumentException(Messages.getString("crypto.35")); //$NON-NLS-1$
     	}
         if (len < 0) {
-            throw new ArrayIndexOutOfBoundsException("len is negative");
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("crypto.36")); //$NON-NLS-1$
         }
     	if ((key.length - offset < len)) {
-    		throw new IllegalArgumentException("key is too short");
+    		throw new IllegalArgumentException(Messages.getString("crypto.37")); //$NON-NLS-1$
     	}
         if (algorithm == null) {
-            throw new IllegalArgumentException("algorithm is null");
+            throw new IllegalArgumentException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
         this.algorithm = algorithm;
         this.key = new byte[len];

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/internal/NullCipherSpi.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/internal/NullCipherSpi.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/internal/NullCipherSpi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/internal/NullCipherSpi.java Tue Sep 26 05:13:47 2006
@@ -36,6 +36,8 @@
 import javax.crypto.NoSuchPaddingException;
 import javax.crypto.ShortBufferException;
 
+import org.apache.harmony.crypto.internal.nls.Messages;
+
 /**
  * CipherSpi implementation for javax.crypto.NullCipher
  * 
@@ -149,7 +151,7 @@
         try {
             output.put(input);
         } catch (java.nio.BufferOverflowException e) {
-            throw new ShortBufferException("output buffer is too small " + e);
+            throw new ShortBufferException(Messages.getString("crypto.0F", e)); //$NON-NLS-1$
         }
         return result;
     }
@@ -190,7 +192,7 @@
      */
     public byte[] engineWrap(Key key) throws IllegalBlockSizeException,
             InvalidKeyException {
-        throw new UnsupportedOperationException("Wrap");
+        throw new UnsupportedOperationException(Messages.getString("crypto.44")); //$NON-NLS-1$
     }
 
     /**
@@ -199,13 +201,13 @@
     public Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm,
             int wrappedKeyType) throws InvalidKeyException,
             NoSuchAlgorithmException {
-        throw new UnsupportedOperationException("Unwrap");
+        throw new UnsupportedOperationException(Messages.getString("crypto.45")); //$NON-NLS-1$
     }
 
     /**
      * See javax.crypto.CipherSpi#engineGetKeySize(Key)
      */
     public int engineGetKeySize(Key key) throws InvalidKeyException {
-        throw new UnsupportedOperationException("GetKeySize");
+        throw new UnsupportedOperationException(Messages.getString("crypto.46")); //$NON-NLS-1$
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/internal/nls/messages.properties?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/internal/nls/messages.properties (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/internal/nls/messages.properties Tue Sep 26 05:13:47 2006
@@ -14,3 +14,73 @@
 # 
 
 # messages for EN locale
+crypto.01=MAC was not initialized
+crypto.02=Algorithm is null
+crypto.03=Provider is null or empty
+crypto.04=Provider is null
+crypto.05=key is null
+crypto.06=Incorrect arguments
+crypto.07=input is null
+crypto.08=Output buffer is null
+crypto.09=Incorrect outOffset parameter: {0}
+crypto.0A=Output buffer is short. It is needed {0} bytes
+crypto.0B=Not initialized Mac
+crypto.0C=input byte buffer is null
+crypto.0D=output byte buffer is null
+crypto.0E=Output is small
+crypto.0F=Output buffer is too small: {0}
+crypto.10=engineWrap(Key key) is not supported
+crypto.11=engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) is not supported
+crypto.12=engineGetKeySize(Key key) is not supported
+crypto.13=Cipher is null\!
+crypto.14=Specified sealed object is null\!
+crypto.15=The provider name is empty or null
+crypto.16=Provider {0} is not available
+crypto.17=Invalid transformation {0}
+crypto.18=Cipher has not yet been initialized
+crypto.19=Invalid mode
+crypto.1A=The public key in the certificate cannot be used for ENCRYPT_MODE
+crypto.1B=The public key in the certificate cannot be used for DECRYPT_MODE
+crypto.1C=Cipher has not yet been initialized properly
+crypto.1D=The input parameter is null
+crypto.1E=Incorrect inputOffset/inputLen parameters
+crypto.1F=The output parameter is null
+crypto.20=Incorrect outputOffset parameter
+crypto.21=Incorrect inputOffset/inputLen parameters
+crypto.22=the encoded parameter is null
+crypto.23=the algName parameter is null
+crypto.24={0} not supported
+crypto.25=the encryptedData parameter is null
+crypto.26=the encryptedData is empty
+crypto.27=the algParams parameter is null
+crypto.28=the cipher parameter is null
+crypto.29=Decrypted data does not represent valid PKCS\#8 PrivateKeyInfo
+crypto.2A=the decryptKey parameter is null
+crypto.2B=the providerName parameter is null
+crypto.2C=the provider parameter is null
+crypto.2D=ExemptionMechanism is not initialized
+crypto.2E=Input and output are the same object
+crypto.2F=Specified key material is null.
+crypto.30=The key material is shorter than 24 bytes.
+crypto.31=iv is null
+crypto.32=iv.length < 2 * (wordSize / 8)
+crypto.33=offset is negative
+crypto.34=iv.length - offset < 2 * (wordSize / 8)
+crypto.35=key is empty
+crypto.36=len is negative
+crypto.37=key is too short
+crypto.38=Specified IV is null.
+crypto.39=iv is null or (iv.length - offset < len)
+crypto.3A=offset < 0 or len < 0
+crypto.3B=Specified salt is null.
+crypto.3C=salt is empty
+crypto.3D=iterationCount is not positive.
+crypto.3E=keyLength is not positive.
+crypto.3F=The password has been cleared.
+crypto.40=The key material is shorter than 8 bytes
+crypto.41=iv is shorter than 8 bytes
+crypto.42=pSrcName is null\!
+crypto.43=encoding input is null\!
+crypto.44=Wrap
+crypto.45=Unwrap
+crypto.46=GetKeySize

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java?view=diff&rev=450013&r1=450012&r2=450013
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java Tue Sep 26 05:13:47 2006
@@ -70,9 +70,9 @@
     
     // Will search OID mappings for these services
     private static final String[] serviceName = {
-            "Cipher",
-            "AlgorithmParameters",
-            "Signature"
+            "Cipher", //$NON-NLS-1$
+            "AlgorithmParameters", //$NON-NLS-1$
+            "Signature" //$NON-NLS-1$
     };
 
     // These mappings CAN NOT be overridden
@@ -80,26 +80,26 @@
     // during maps initialization
     // (source: http://asn1.elibel.tm.fr):
     private static final String[][] knownAlgMappings = {
-        {"1.2.840.10040.4.1",       "DSA"},
-        {"1.2.840.10040.4.3",       "SHA1withDSA"},
-        {"1.2.840.113549.1.1.1",    "RSA"},
-        {"1.2.840.113549.1.1.2",    "MD2withRSA"},
-        {"1.2.840.113549.1.1.4",    "MD5withRSA"},
-        {"1.2.840.113549.1.1.5",    "SHA1withRSA"},
-        {"1.2.840.113549.1.3.1",    "DiffieHellman"},
-        {"1.2.840.113549.1.5.3",    "pbeWithMD5AndDES-CBC"},
-        {"1.2.840.113549.1.12.1.3", "pbeWithSHAAnd3-KeyTripleDES-CBC"},
-        {"1.2.840.113549.1.12.1.6", "pbeWithSHAAnd40BitRC2-CBC"},
-        {"1.2.840.113549.3.2",      "RC2-CBC"},
-        {"1.2.840.113549.3.3",      "RC2-EBC"},
-        {"1.2.840.113549.3.4",      "RC4"},
-        {"1.2.840.113549.3.5",      "RC4WithMAC"},
-        {"1.2.840.113549.3.6",      "DESx-CBC"},
-        {"1.2.840.113549.3.7",      "TripleDES-CBC"},
-        {"1.2.840.113549.3.8",      "rc5CBC"},
-        {"1.2.840.113549.3.9",      "RC5-CBC"},
-        {"1.2.840.113549.3.10",     "DESCDMF"},
-        {"2.23.42.9.11.4.1",        "ECDSA"},
+        {"1.2.840.10040.4.1",       "DSA"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.10040.4.3",       "SHA1withDSA"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.1.1.1",    "RSA"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.1.1.2",    "MD2withRSA"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.1.1.4",    "MD5withRSA"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.1.1.5",    "SHA1withRSA"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.1.3.1",    "DiffieHellman"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.1.5.3",    "pbeWithMD5AndDES-CBC"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.1.12.1.3", "pbeWithSHAAnd3-KeyTripleDES-CBC"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.1.12.1.6", "pbeWithSHAAnd40BitRC2-CBC"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.3.2",      "RC2-CBC"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.3.3",      "RC2-EBC"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.3.4",      "RC4"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.3.5",      "RC4WithMAC"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.3.6",      "DESx-CBC"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.3.7",      "TripleDES-CBC"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.3.8",      "rc5CBC"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.3.9",      "RC5-CBC"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"1.2.840.113549.3.10",     "DESCDMF"}, //$NON-NLS-1$ //$NON-NLS-2$
+        {"2.23.42.9.11.4.1",        "ECDSA"}, //$NON-NLS-1$ //$NON-NLS-2$
     };
     // Maps alg name to OID
     private static final HashMap alg2OidMap = new HashMap();
@@ -175,7 +175,7 @@
     private static void selectEntries(Provider p) {
         Set entrySet = p.entrySet();
         for (int i=0; i<serviceName.length; i++) {
-            String keyPrfix2find = "Alg.Alias." + serviceName[i] + "."; 
+            String keyPrfix2find = "Alg.Alias." + serviceName[i] + ".";  //$NON-NLS-1$ //$NON-NLS-2$
             for (Iterator it = entrySet.iterator(); it.hasNext();) {
                 Map.Entry me = (Map.Entry)it.next();
                 String key = (String)me.getKey();
@@ -184,7 +184,7 @@
                     String alg = (String)me.getValue();
                     String algUC = alg.toUpperCase();
                     if (isOID(alias)) {
-                        if (alias.startsWith("OID.")) {
+                        if (alias.startsWith("OID.")) { //$NON-NLS-1$
                             alias = alias.substring(4);
                         }
                         // Do not overwrite already known mappings
@@ -235,7 +235,7 @@
      * @return string passed without leading "OID." 
      */
     public static String normalize(String oid) {
-        return oid.startsWith("OID.")
+        return oid.startsWith("OID.") //$NON-NLS-1$
             ? oid.substring(4)
             : oid;
     }
@@ -245,11 +245,11 @@
      * @return Internal maps String representation
      */
     public static String dump() {
-        StringBuffer sb = new StringBuffer("alg2OidMap: ");
+        StringBuffer sb = new StringBuffer("alg2OidMap: "); //$NON-NLS-1$
         sb.append(alg2OidMap);
-        sb.append("\noid2AlgMap: ");
+        sb.append("\noid2AlgMap: "); //$NON-NLS-1$
         sb.append(oid2AlgMap);
-        sb.append("\nalgAliasesMap: ");
+        sb.append("\nalgAliasesMap: "); //$NON-NLS-1$
         sb.append(algAliasesMap);
         return sb.toString();
     }



Mime
View raw message