summaryrefslogtreecommitdiffstats
path: root/pki/base/util
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/util')
-rw-r--r--pki/base/util/src/CMakeLists.txt9
-rw-r--r--pki/base/util/src/com/netscape/cmsutil/util/Utils.java6
-rw-r--r--pki/base/util/test/CMakeLists.txt4
3 files changed, 14 insertions, 5 deletions
diff --git a/pki/base/util/src/CMakeLists.txt b/pki/base/util/src/CMakeLists.txt
index 919b593e7..0c78ac3b7 100644
--- a/pki/base/util/src/CMakeLists.txt
+++ b/pki/base/util/src/CMakeLists.txt
@@ -24,6 +24,13 @@ find_file(OSUTIL_JAR
/usr/share/java
)
+find_file(COMMONS_CODEC_JAR
+ NAMES
+ commons-codec.jar
+ PATHS
+ /usr/share/java
+)
+
find_file(XALAN_JAR
NAMES
xalan-j2.jar
@@ -332,7 +339,7 @@ set(pki-cmsutil_java_SRCS
set(CMAKE_JAVA_INCLUDE_PATH
${LDAPJDK_JAR} ${XALAN_JAR} ${XERCES_JAR}
- ${JSS_JAR} ${OSUTIL_JAR})
+ ${JSS_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR})
set(CMAKE_JAVA_TARGET_VERSION ${APPLICATION_VERSION})
diff --git a/pki/base/util/src/com/netscape/cmsutil/util/Utils.java b/pki/base/util/src/com/netscape/cmsutil/util/Utils.java
index a1801785c..303566416 100644
--- a/pki/base/util/src/com/netscape/cmsutil/util/Utils.java
+++ b/pki/base/util/src/com/netscape/cmsutil/util/Utils.java
@@ -17,6 +17,8 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmsutil.util;
+import org.apache.commons.codec.binary.Base64;
+
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
@@ -263,12 +265,12 @@ public class Utils {
}
public static String base64encode(byte[] bytes) {
- String string = com.netscape.osutil.OSUtil.BtoA(bytes);
+ String string = new Base64(64).encodeToString(bytes);
return string;
}
public static byte[] base64decode(String string) {
- byte[] bytes = com.netscape.osutil.OSUtil.AtoB(string);
+ byte[] bytes = Base64.decodeBase64(string);
return bytes;
}
}
diff --git a/pki/base/util/test/CMakeLists.txt b/pki/base/util/test/CMakeLists.txt
index b9aa4eb16..042731f3b 100644
--- a/pki/base/util/test/CMakeLists.txt
+++ b/pki/base/util/test/CMakeLists.txt
@@ -19,7 +19,7 @@ set(pki-util-test_SRCS
set(CMAKE_JAVA_INCLUDE_PATH
${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
- ${JSS_JAR} ${LDAPJDK_JAR} ${OSUTIL_JAR} ${XALAN_JAR} ${XERCES_JAR}
+ ${JSS_JAR} ${LDAPJDK_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR} ${XALAN_JAR} ${XERCES_JAR}
${PKI_TEST_JAR} ${JUNIT_JAR}
)
@@ -39,7 +39,7 @@ add_junit_test(test-pki-util
CLASSPATH
${pki-util-test_JAR_FILE}
${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
- ${JSS_JAR} ${LDAPJDK_JAR} ${OSUTIL_JAR}
+ ${JSS_JAR} ${LDAPJDK_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR}
${PKI_TEST_JAR} ${JUNIT_JAR}
TESTS
com.netscape.security.util.BMPStringTest