sam2099 opened a new issue, #1022:
URL: https://github.com/apache/shiro/issues/1022

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/shiro/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Question
   
    I use  shiro 2.0.0-alpha-2 with shiro 1 's  hash Algorithm "SHA-256"   ,  
exception as below: 
    
   ```java
   public static String str2SHA256(String str)
       {
           DefaultPasswordService passwordService = new 
DefaultPasswordService();
           passwordService.setHashService(new DefaultHashService()
           {
               {
                   setDefaultAlgorithmName("SHA-256");
               }
           });
           String encryptedValue = passwordService.encryptPassword(str);
           return encryptedValue;
       }
   ```
   
   exception: 
   ```java
   Exception in thread "main" java.lang.UnsupportedOperationException: 
Shiro2CryptFormat can only format classes extending AbstractCryptHash.
        at 
org.apache.shiro.crypto.hash.format.Shiro2CryptFormat.format(Shiro2CryptFormat.java:107)
        at 
org.apache.shiro.authc.credential.DefaultPasswordService.encryptPassword(DefaultPasswordService.java:83)
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to