X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;ds=sidebyside;f=src%2Forg%2Fcacert%2Fgigi%2Futil%2FPasswordHash.java;h=ed0d4f3c251903a0400552e1db0f6b2a1e75b20e;hb=46dd85120b48c942c00f61775c4c840e956d02df;hp=d6b0b9066b7ab11ec72177e883f1156227fc3ce7;hpb=4a16fea18675eaac13439f1dcefede4a49d9164e;p=gigi.git diff --git a/src/org/cacert/gigi/util/PasswordHash.java b/src/org/cacert/gigi/util/PasswordHash.java index d6b0b906..ed0d4f3c 100644 --- a/src/org/cacert/gigi/util/PasswordHash.java +++ b/src/org/cacert/gigi/util/PasswordHash.java @@ -1,5 +1,6 @@ package org.cacert.gigi.util; +import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -7,9 +8,28 @@ import com.lambdaworks.crypto.SCryptUtil; public class PasswordHash { - public static boolean verifyHash(String password, String hash) { + /** + * Verifies a password hash. + * + * @param password + * The password that should result in the given hash. + * @param hash + * The hash to verify the password against. + * @return
null
, if the password was validhash
, if the password is valid and the hash
+ * doesn't need to be updated