【发布时间】:2014-12-08 17:05:54
【问题描述】:
在这种情况下我无法使用 jaspyt:
StrongTextEncryptor textEncryptor = new StrongTextEncryptor();
textEncryptor.setPassword("myPassword");
String myEncryptedParam = textEncryptor.encrypt("myClearMessage");
myObject.setCallbackUrl("http://myhost/notification?myparam="+myEncryptedParam);
当我收到回调 url 并尝试使用请求中使用的相同 STRONGTEXTENCRYPTOR 解密 url 中提供的参数“myParam”时,会引发异常:
org.jasypt.exceptions.EncryptionOperationNotPossibleException
at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:1055)
at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:725)
at org.jasypt.util.text.StrongTextEncryptor.decrypt(StrongTextEncryptor.java:118)
at com.softlysoftware.caligraph.util.Util.decryptMessage(Util.java:30)
在我得到的异常中进一步挖掘:
BadPaddingException: Given final block not properly padded
如果我在没有 httprequest 的情况下测试加密/解密过程,就可以了。
【问题讨论】:
标签: java http url encryption jasypt