Package com.avoka.fc.core.security
Class ShaPasswordEncoder
java.lang.Object
com.avoka.fc.core.security.ShaPasswordEncoder
- All Implemented Interfaces:
org.springframework.security.crypto.password.PasswordEncoder
public class ShaPasswordEncoder
extends Object
implements org.springframework.security.crypto.password.PasswordEncoder
Provides a password encoder using Argon2 hashing algorithms.
- See Also:
-
PasswordEncoder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
comparePassword
(String rawPassword, String prefixEncodedPassword) Compare a given password to a stored hash valuecreatePassword
(String rawPassword) Generate hashed passwordencode
(CharSequence rawPassword) com.avoka.core.storage.IPasswordService
Return the password service.boolean
matches
(CharSequence rawPassword, String prefixEncodedPassword) boolean
upgradeEncoding
(String encodedPassword)
-
Constructor Details
-
ShaPasswordEncoder
public ShaPasswordEncoder()Create a PasswordEncoder
-
-
Method Details
-
getPasswordService
public com.avoka.core.storage.IPasswordService getPasswordService()Return the password service.- Returns:
- the password service
-
comparePassword
Compare a given password to a stored hash value- Parameters:
rawPassword
- the non-null passwordprefixEncodedPassword
- the non-null hash value to compare against- Returns:
- true if the password matches the hash value
- Since:
- 21.11.0
-
createPassword
Generate hashed password- Parameters:
rawPassword
- the non-null password- Returns:
- the encoded hashed password
- Since:
- 21.11.0
-
encode
- Specified by:
encode
in interfaceorg.springframework.security.crypto.password.PasswordEncoder
-
matches
- Specified by:
matches
in interfaceorg.springframework.security.crypto.password.PasswordEncoder
-
upgradeEncoding
- Specified by:
upgradeEncoding
in interfaceorg.springframework.security.crypto.password.PasswordEncoder
-