- protected String digestIfNecessary(String str) {
- if (!str.startsWith("{" + digestType + "}"))
- return digest(str);
- else
- return str;
- }
-
- protected String digest(String nonEncrypted) {
- try {
- MessageDigest md = MessageDigest.getInstance(digestType);
- byte[] dig = md.digest(nonEncrypted.getBytes());
- return "{" + digestType + "}"
- + new String(Base64.encodeBase64(dig));
- } catch (NoSuchAlgorithmException e) {
- throw new RuntimeException(
- "Unexpected exception while digesting password");
- }
- }
+ // protected String digestIfNecessary(String str) {
+ //
+ // if (!str.startsWith("{" + digestType + "}"))
+ // return digest(str);
+ // else
+ // return str;
+ // }
+
+ // protected String digest(String nonEncrypted) {
+ // try {
+ // MessageDigest md = MessageDigest.getInstance(digestType);
+ // byte[] dig = md.digest(nonEncrypted.getBytes());
+ // return "{" + digestType + "}"
+ // + new String(Base64.encodeBase64(dig));
+ // } catch (NoSuchAlgorithmException e) {
+ // throw new RuntimeException(
+ // "Unexpected exception while digesting password");
+ // }
+ // }