diff options
Diffstat (limited to 'base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java')
-rw-r--r-- | base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java b/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java index 6579261f6..8aebebad0 100644 --- a/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java +++ b/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java @@ -1666,16 +1666,16 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove // convert "rawData" into "base64Data" if (rawData != null) { String base64Data = CMS.BtoA(rawData).trim(); - String key = ""; + StringBuffer key = new StringBuffer(); // extract all line separators from the "base64Data" for (int i = 0; i < base64Data.length(); i++) { if (base64Data.substring(i, i).getBytes() != EOL) { - key += base64Data.substring(i, i); + key.append(base64Data.substring(i, i)); } } - return key; + return key.toString(); } return ILogger.SIGNED_AUDIT_EMPTY_VALUE; @@ -1710,7 +1710,7 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove } String key = null; - + StringBuffer tempBuffer = new StringBuffer(); // convert "rawData" into "base64Data" if (rawData != null) { String base64Data = null; @@ -1720,11 +1720,15 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove // extract all line separators from the "base64Data" for (int i = 0; i < base64Data.length(); i++) { if (base64Data.substring(i, i).getBytes() != EOL) { - key += base64Data.substring(i, i); + tempBuffer.append(base64Data.substring(i, i)); } } } + if (tempBuffer.length() > 0) { + key = tempBuffer.toString(); + } + if (key != null) { key = key.trim(); |