summaryrefslogtreecommitdiffstats
path: root/base/common/src/org
diff options
context:
space:
mode:
authorChristina Fu <cfu@redhat.com>2014-07-31 15:03:19 -0700
committerChristina Fu <cfu@redhat.com>2014-08-04 14:20:09 -0700
commit855459bdd16538da63935bc38373c4e412c9e0f1 (patch)
treee551c7f9f2985eaf9793cea1b5c25e703ce6bae9 /base/common/src/org
parent3cbd3f4fd71bace3e1b5020defba07a3311d082a (diff)
downloadpki-855459bdd16538da63935bc38373c4e412c9e0f1.tar.gz
pki-855459bdd16538da63935bc38373c4e412c9e0f1.tar.xz
pki-855459bdd16538da63935bc38373c4e412c9e0f1.zip
ticket#882 tokendb management, policy, and activities, 1st cut
Diffstat (limited to 'base/common/src/org')
-rw-r--r--base/common/src/org/dogtagpki/tps/main/TPSBuffer.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/base/common/src/org/dogtagpki/tps/main/TPSBuffer.java b/base/common/src/org/dogtagpki/tps/main/TPSBuffer.java
index 43ff2ea1d..242f0825e 100644
--- a/base/common/src/org/dogtagpki/tps/main/TPSBuffer.java
+++ b/base/common/src/org/dogtagpki/tps/main/TPSBuffer.java
@@ -284,7 +284,26 @@ public class TPSBuffer {
result.append(HEX_DIGITS.charAt((c & 0xF0) >> 4));
result.append(HEX_DIGITS.charAt(c & 0x0F));
result.append("%");
+ }
+
+ return result.toString();
+ }
+ /*
+ * toHexString - this version returns hex string without the'%'
+ * @return the hex representation of the buffer
+ */
+ public String toHexStringPlain() {
+ final String HEX_DIGITS = "0123456789ABCDEF";
+
+ StringBuffer result = new StringBuffer(buf.length * 2);
+
+ for (int i = 0; i < buf.length; i++)
+ {
+ char c = (char) buf[i];
+
+ result.append(HEX_DIGITS.charAt((c & 0xF0) >> 4));
+ result.append(HEX_DIGITS.charAt(c & 0x0F));
}
return result.toString();