Package org.codehaus.cargo.daemon
Class PasswordWithHash
- java.lang.Object
-
- org.codehaus.cargo.daemon.PasswordWithHash
-
public class PasswordWithHash extends Object
Password holder, with support for hashing.
-
-
Constructor Summary
Constructors Constructor Description PasswordWithHash(String passwordWithDigest)
Save password, which can use hashes, for example{MD5}9addb63b65b01292700094b0ef056036
or{SHA-1}2681c738294805939045be2a4af53b687c25bf4d
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(String password)
Checks if the given password matches the stored one (or its hash).
-
-
-
Constructor Detail
-
PasswordWithHash
public PasswordWithHash(String passwordWithDigest) throws NoSuchAlgorithmException
Save password, which can use hashes, for example{MD5}9addb63b65b01292700094b0ef056036
or{SHA-1}2681c738294805939045be2a4af53b687c25bf4d
. The hashing algorithms can be any algorithm supported byMessageDigest
.- Parameters:
passwordWithDigest
- Password (could be hashed).- Throws:
NoSuchAlgorithmException
- If the digest algorithm isn't known to the JVM.
-
-
Method Detail
-
matches
public boolean matches(String password)
Checks if the given password matches the stored one (or its hash).- Parameters:
password
- Password to check.- Returns:
true
if the given password matches the stored one (or its hash),false
otherwise.
-
-