OpenSSL smime 验证失败,证书和签名正确
我收到加密和签名的 smime 消息。 解密没问题,数据看起来是正确的。
openssl.exe smime -decrypt -in %1 -out %1_signed.txt -inkey myPrivate.pem
但在验证签名阶段我收到错误。
openssl.exe smime -verify -CAfile senderCACert.pem -certfile senderCert.pem -in %1 -out %1_plain
Verification failure
7600:error:21071065:PKCS7 routines:PKCS7_signatureVerify:digest failure:./crypto/pkcs7/pk7_doit.c:9
48:
7600:error:21075069:PKCS7 routines:PKCS7_verify:signature failure:./crypto/pkcs7/pk7_smime.c:312:
发送两个证书(CA 证书和客户端证书)应该没问题。
我认为 openssl 可以在解密过程中生成特定符号,例如换行符或源消息中不存在的其他符号。或者它可以处理非标准算法(至少据我所知openssl具有非标准的私钥存储格式)
我使用openssl 0.9.8h。而另一边的smime消息是由“webMethods EDI version 6.5”软件形成的(它是处理EDI消息的AS2服务器)。
这个错误的原因是什么?
你能推荐另一个 smime 工具来尝试吗?
I receive encrypted and signed smime message.
Decrypting is ok, data seems to be correct.
openssl.exe smime -decrypt -in %1 -out %1_signed.txt -inkey myPrivate.pem
But on verifying signature stage I get error.
openssl.exe smime -verify -CAfile senderCACert.pem -certfile senderCert.pem -in %1 -out %1_plain
Verification failure
7600:error:21071065:PKCS7 routines:PKCS7_signatureVerify:digest failure:./crypto/pkcs7/pk7_doit.c:9
48:
7600:error:21075069:PKCS7 routines:PKCS7_verify:signature failure:./crypto/pkcs7/pk7_smime.c:312:
Sender both certificates (CA cert and client cert) should be ok.
I think that openssl can produce specific symbols during decrypting like new-line character or something else that doesn't exist in source message. Or it could process non-standard algorythm (at least as far as I know openssl has non-standard storage format of private keys)
I use openssl 0.9.8h. And smime message on other side is formed by "webMethods EDI version 6.5" software (it is AS2 server for processing EDI messages).
What is the reason of this error?
Could you advise another smime tool to try?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
[简介]
感谢您提出问题;-) 我终于花了一些时间来正式确定如何使用 OpenSSL 调试 AS2 通信。
[背景] (1) 我正在开发 BabelAS2 - http://code.google.com/p/babelas2 / - EDIINT AS2 (RFC 4130) 标准传输协议的开源 VBScript 实现。我使用 CAPICOM 作为密码学库。 (2) 我想检查如何使用 http://www.shininglightpro.com 中的“Win32 OpenSSL v0.9.8q” 调试加密部分;-)
[解决方案#1] 解密 HTTP 有效负载:
在 HTTP 有效负载转储的顶部手动添加以下文本
然后,您可以使用:
[SOLUTION#2] 解密消息的签名:
只需使用
让我知道它是否对您有帮助...
[INTRO]
Thanks for your question ;-) I have finally taken some time to formalize how I can debug my AS2 communication using OpenSSL.
[BACKGROUND] (1) I am developing BabelAS2 - http://code.google.com/p/babelas2/ - an open source VBScript implementation of the EDIINT AS2 (RFC 4130) standard transport protocol. I am using CAPICOM as the Cryptography library. (2) I wanted to check how I can use "Win32 OpenSSL v0.9.8q" from http://www.shininglightpro.com to debug the cryptography part ;-)
[SOLUTION#1] Decrypt the HTTP payload:
Manually add the following text on top of the dump of the HTTP payload
Then, you can use:
[SOLUTION#2] Very the signature of the decrypted message:
Just use
Let me know if it helped you...