All getBytes("UTF-8") -> StringUtils
[nikiroo-utils.git] / src / be / nikiroo / utils / CryptUtils.java
index 72c9c44b449a5e0ef782cb560dfe044c0c6e8840..9ef91015ad14f0ecc5c3d45f3f242628160146cc 100644 (file)
@@ -293,13 +293,7 @@ public class CryptUtils {
         *             it was)
         */
        public byte[] encrypt(String data) throws SSLException {
-               try {
-                       return encrypt(data.getBytes("UTF8"));
-               } catch (UnsupportedEncodingException e) {
-                       // UTF-8 is required in all confirm JVMs
-                       e.printStackTrace();
-                       return null;
-               }
+               return encrypt(StringUtils.getBytes(data));
        }
 
        /**
@@ -319,13 +313,7 @@ public class CryptUtils {
         *             it was)
         */
        public String encrypt64(String data) throws SSLException {
-               try {
-                       return encrypt64(data.getBytes("UTF8"));
-               } catch (UnsupportedEncodingException e) {
-                       // UTF-8 is required in all confirm JVMs
-                       e.printStackTrace();
-                       return null;
-               }
+               return encrypt64(StringUtils.getBytes(data));
        }
 
        /**