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

Posted mry6

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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;
}

以上是关于org.apache.shiro.crypto.CryptoException: Unable to execute ‘doFinal‘ with cipher instance的主要内容,如果未能解决你的问题,请参考以下文章