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
Constructors Constructor Description ShaPasswordEncoder()
Create a PasswordEncoder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
comparePassword(String rawPassword, String prefixEncodedPassword)
Compare a given password to a stored hash valueString
createPassword(String rawPassword)
Generate hashed passwordString
encode(CharSequence rawPassword)
com.avoka.core.storage.IPasswordService
getPasswordService()
Return the password service.boolean
matches(CharSequence rawPassword, String prefixEncodedPassword)
boolean
upgradeEncoding(String encodedPassword)
-
-
-
Method Detail
-
getPasswordService
public com.avoka.core.storage.IPasswordService getPasswordService()
Return the password service.- Returns:
- the password service
-
comparePassword
public boolean comparePassword(String rawPassword, String prefixEncodedPassword)
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
public String createPassword(String rawPassword)
Generate hashed password- Parameters:
rawPassword
- the non-null password- Returns:
- the encoded hashed password
- Since:
- 21.11.0
-
encode
public String encode(CharSequence rawPassword)
- Specified by:
encode
in interfaceorg.springframework.security.crypto.password.PasswordEncoder
-
matches
public boolean matches(CharSequence rawPassword, String prefixEncodedPassword)
- Specified by:
matches
in interfaceorg.springframework.security.crypto.password.PasswordEncoder
-
upgradeEncoding
public boolean upgradeEncoding(String encodedPassword)
- Specified by:
upgradeEncoding
in interfaceorg.springframework.security.crypto.password.PasswordEncoder
-
-