Class StrongPasswordProcessor
- java.lang.Object
-
- io.pravega.shared.security.crypto.StrongPasswordProcessor
-
public class StrongPasswordProcessor extends java.lang.ObjectThis class implements a a `PBKDF2WithHmacSHA1` based password digest creator and validator. Following steps are taken during the creation of the digest: 1. A salt is generated. 2. The password is encoded with this salt. 3. Number of iterations, salt and this password is string encoded and concatenated with ":" as separator. 4. This whole string is again string encoded with base 16. For validation these steps are reversed to get the password digest from the stored password. The incoming password is digested with the retrieved iterations and salt. The generated digest is then cross checked against the created digest.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStrongPasswordProcessor.StrongPasswordProcessorBuilder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StrongPasswordProcessor.StrongPasswordProcessorBuilderbuilder()booleancheckPassword(char[] password, java.lang.String encryptedPassword)java.lang.StringencryptPassword(java.lang.String userPassword)
-
-
-
Method Detail
-
checkPassword
public boolean checkPassword(char[] password, java.lang.String encryptedPassword) throws java.security.NoSuchAlgorithmException, java.security.spec.InvalidKeySpecException- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.spec.InvalidKeySpecException
-
encryptPassword
public java.lang.String encryptPassword(java.lang.String userPassword) throws java.security.NoSuchAlgorithmException, java.security.spec.InvalidKeySpecException- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.spec.InvalidKeySpecException
-
builder
public static StrongPasswordProcessor.StrongPasswordProcessorBuilder builder()
-
-