org.apache.shiro.crypto.CryptoException: Unable to execute ‘doFinal‘ with cipher instance

org.apache.shiro.crypto.CryptoException: Unable to execute 'doFinal' with cipher instance

错误信息

在这里插入图片描述

解决方案

在凭证匹配器添加下面圈红代码:

/**
* 方法名:
* 功能:凭证匹配器
* 描述:指定shiro加密方式和次数
*/
@Bean(name = "customCredentialsMatch")
public CustomCredentialsMatch hashedCredentialsMatch(){
    
    
	CustomCredentialsMatch hashedCredentialsMatch = new CustomCredentialsMatch();
	hashedCredentialsMatch.setHashAlgorithmName("MD5");
	hashedCredentialsMatch.setHashIterations(1024);
	hashedCredentialsMatch.setStoredCredentialsHexEncoded(true);
	return hashedCredentialsMatch;
}

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/muriyue6/article/details/121150003