Class ShiroPasswordEncoder

  • All Implemented Interfaces:
    PasswordEncoder

    public class ShiroPasswordEncoder
    extends java.lang.Object
    implements PasswordEncoder
    A password encoder based on PasswordService from Apache Shiro Add the shiro-core dependency to use this class.
    Since:
    1.9.2
    Author:
    Victor Noël
    • Constructor Summary

      Constructors 
      Constructor Description
      ShiroPasswordEncoder​(org.apache.shiro.authc.credential.PasswordService delegate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String encode​(java.lang.String password)
      Encode a password.
      org.apache.shiro.authc.credential.PasswordService getDelegate()  
      boolean matches​(java.lang.String plainPassword, java.lang.String encodedPassword)
      Validate if a plainPassword matches
      void setDelegate​(org.apache.shiro.authc.credential.PasswordService delegate)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShiroPasswordEncoder

        public ShiroPasswordEncoder​(org.apache.shiro.authc.credential.PasswordService delegate)
    • Method Detail

      • encode

        public java.lang.String encode​(java.lang.String password)
        Description copied from interface: PasswordEncoder
        Encode a password.
        Specified by:
        encode in interface PasswordEncoder
        Parameters:
        password - the not encoded password
        Returns:
        the encoded password
      • matches

        public boolean matches​(java.lang.String plainPassword,
                               java.lang.String encodedPassword)
        Description copied from interface: PasswordEncoder
        Validate if a plainPassword matches
        Specified by:
        matches in interface PasswordEncoder
        Parameters:
        plainPassword - the not encoded password to check
        encodedPassword - the encoded password
        Returns:
        true if they match
      • getDelegate

        public org.apache.shiro.authc.credential.PasswordService getDelegate()
      • setDelegate

        public void setDelegate​(org.apache.shiro.authc.credential.PasswordService delegate)