Class 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 Detail

      • ShaPasswordEncoder

        public ShaPasswordEncoder()
        Create a PasswordEncoder
    • 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 password
        prefixEncodedPassword - 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 interface org.springframework.security.crypto.password.PasswordEncoder
      • matches

        public boolean matches​(CharSequence rawPassword,
                               String prefixEncodedPassword)
        Specified by:
        matches in interface org.springframework.security.crypto.password.PasswordEncoder
      • upgradeEncoding

        public boolean upgradeEncoding​(String encodedPassword)
        Specified by:
        upgradeEncoding in interface org.springframework.security.crypto.password.PasswordEncoder