InvalidPasswordCipherException when using com.ibm.websphere.



我正在使用以下版本的 WebSphere:

Launching defaultServer (WebSphere Application Server 19.0.0.6/wlp-1.0.29.cl190620190617-1530) on IBM J9 VM, version 8.0.5.37 - pxa6480sr5fp37-20190618_01(SR5 FP37) (en_US)
[AUDIT   ] CWWKE0001I: The server defaultServer has been launched.

我已将以下内容添加到build.gradle

compile("com.ibm.websphere.appserver.spi:com.ibm.websphere.appserver.spi.kernel.service:1.5.15")

bootstrap.properties中,有一个AES编码的字符串:

user@service-pod:/opt/ibm/wlp/usr/servers/defaultServer$ cat bootstrap.properties 
SECRET="{aes}AJIZlX1899cct50fB2yUIcNdD5rp0yVhxtPnNKyuShGQh0T+VBzxnfU5G1S9hCYQioa3/hMj+qPAUnliv96B6aFAsWnGk7RiY42yslztDT6Y"

使用编码:securityUtility encode --encoding=aes $PLAINTEXT

但是当我尝试使用以下方法从 Java Web 应用程序中解码字符串时:

System.out.println(PasswordUtil.decode(System.getProperty("SECRET")));

我收到此异常:

org.apache.cxf.interceptor.Fault: com.ibm.ws.crypto.util.InvalidPasswordCipherException
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162)
at [internal classes]
Caused by: java.lang.NoClassDefFoundError: com.ibm.ws.crypto.util.InvalidPasswordCipherException

知道为什么吗?

需要server.xml

<feature>passwordUtilities-1.0</feature>

最新更新