java.security.SignatureException: Signature length not correct: got 128 but was expecting 64

扬烽 发布于 2016/06/29 19:08
阅读 4K+
收藏 0
java.security.SignatureException: Signature length not correct: got 128 but was expecting 64
at sun.security.rsa.RSASignature.engineVerify(RSASignature.java:189)
at java.security.Signature$Delegate.engineVerify(Signature.java:1172)
at java.security.Signature.verify(Signature.java:623)
at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:446)

at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:394)

先从pfx文件导出cer文件,然后用pfx签名,再用cer验签。出现上面异常,一般什么原因?

(jdk1.7)

加载中
0
扬烽

问题已经得到解决。

一般情况出现上面异常,应该就是公钥证书不对,验签不能通过。我遇到上面的情况是因为,没看验签源码。想当然的认为私钥签名,公钥验签的逻辑。实际上验签工具类重在需要的是根证书,验证公钥证书真伪。

最后该问题如何关闭呢?

返回顶部
顶部