harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r764770 - /harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java
Date Tue, 14 Apr 2009 13:14:38 GMT
Author: odeakin
Date: Tue Apr 14 13:14:38 2009
New Revision: 764770

URL: http://svn.apache.org/viewvc?rev=764770&view=rev
Log:
Make sure we get the certificate bytes in UTF-8 encoding for non-ASCII platforms.

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java?rev=764770&r1=764769&r2=764770&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java
Tue Apr 14 13:14:38 2009
@@ -26,6 +26,7 @@
 import java.io.ByteArrayInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
 import java.security.NoSuchAlgorithmException;
@@ -305,7 +306,13 @@
             + "JDSM\n" + "-----END CERTIFICATE-----\n";
 
     public static byte[] getEncodedX509Certificate() {
-        return ENCODED_X509_CERTIFICATE.getBytes();
+        byte cert[];
+        try {
+            cert = ENCODED_X509_CERTIFICATE.getBytes("UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e.getMessage());
+        }
+        return cert;
     }
     
     /**



Mime
View raw message