如何解决java.security.spec.InvalidKeySpecException:密码不是ASCII

时间:2019-01-08 05:22:47

标签: java-security

我有一个名为test_PBE_Triple_DES的测试,在这里我使用PBE_DES3_CBC_SHA1_ALGORITHM来解码加密的密码,但是每当我尝试执行它时,我都会收到一条错误消息,提示密码不是ascii。

我在下面提供了堆栈跟踪。

com.tibco.security.AXSecurityException: java.security.spec.InvalidKeySpecException: Password is not ASCII
    at com.tibco.security.providers.CryptoVendorImpl_j2se.rename(CryptoVendorImpl_j2se.java:205)
    at com.tibco.security.Crypto.rename(Crypto.java:59)
    at com.tibco.security.TestPassword.test_PBE_Triple_DES(TestPassword.java:105)
Caused by: java.security.spec.InvalidKeySpecException: Password is not ASCII
    at com.sun.crypto.provider.PBEKey.<init>(PBEKey.java:64)
    at com.sun.crypto.provider.PBEKeyFactory.engineGenerateSecret(PBEKeyFactory.java:219)
    at javax.crypto.SecretKeyFactory.generateSecret(SecretKeyFactory.java:330)
    at com.tibco.security.providers.CryptoVendorImpl_j2se.rename(CryptoVendorImpl_j2se.java:161)

0 个答案:

没有答案