pbkdf2: fix encoding issue when converting byte[] to String

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 814e5574dc)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2015-02-28 00:42:27 +05:30
parent 3786aa0e67
commit 694a694860
1 changed files with 2 additions and 2 deletions

View File

@ -133,8 +133,8 @@ public class PBKDF2UserAuthenticator extends DefaultUserAuthenticator {
return !(plainPassword == null || plainPassword.isEmpty() || hash == null || hash.length == 0);
}
private static String encode(byte[] input) {
return new String(Base64.encode(input));
private static String encode(byte[] input) throws UnsupportedEncodingException {
return new String(Base64.encode(input), "UTF-8");
}
private static byte[] decode(String input) throws UnsupportedEncodingException {