错误提示
在EDI系统中,已经收到对方发送的文档,但系统提示:消息解密失败
原因分析
在电子数据交换系统中,通常每年要进行我方和对方的数字证书更新。更新要在两边同步进行,如果对方更新证书 以后我方未更新,就会出现对方用新证书加密,我方用旧证书解密,就会报以上错误。
解决办法
- 检查对方发送的新证书,在我方服务器是否已经安装完毕;
- 与对方确认发送的证书是否正确
命令:
keytool -exportcert -keystore keystore.p12 -storepass 123456 -alias keyname -file cert-2019.cer
参数解释:
命令:
keytool -genkey -alias myalias -keysize 2048 -keyalg RSA -validity 730
-keystore mykeystore.jks
参数解释:
命令:
keytool -importkeystore -destkeystore as2_certs.p12 -deststorepass testas2 -srckeystore newcerts.pfx -srcstorepass newcertpass -srcalias 1 -destalias mycert2019 -deststoretype pkcs12 -destkeypass 123456
参数解释:
命令:
openssl s_client -state -key gateway.key -cert gateway.cer -CAfile ca.cer -connect xxx-hub-b2b2.xxx.com:443 –crlf
参数解释:
1.私钥文件,pem格式,保存在文件gateway.key中
2.证书文件,pem格式,保存在文件gateway.pem中
3.中级CA及根证书,pem格式,一起保存在文件ca.cer中