华为云会议 MEETING-Demo 包完整性校验:数字签名CMS文件验签操作步骤

时间:2025-01-09 21:21:18

数字签名CMS文件验签操作步骤

1.在"Demo安装包下载"章节中,“表1 Android/Windows/Mac/Electron Demo资源下载路径”中下载的Demo包;

2.下载Demo包到本地;

3.从华为support官网https://support.huawei.com/additionalres/pki 下载根CA证书和4个吊销证书,文件如下:

CA文件:Huawei Software Integrity Protection Root CA.der

CRL文件:HuaweiRootCA.crl、HuaweiCodeSigningCA.crl、HuaweiCodeSigningCA 2.crl、HuaweiCodeSigningCA 3.crl

4.转换CA证书与CRL文件格式从DER到PEM

CRL文件:

openssl crl -inform DER -in "HuaweiRootCA.crl" -out HuaweiRootCaCrl.pem
openssl crl -inform DER -in "HuaweiCodeSigningCA 3.crl" -out HuaweiCodeSigningCA3.pem
openssl crl -inform DER -in "HuaweiCodeSigningCA 2.crl" -out HuaweiCodeSigningCA2.pem
openssl crl -inform DER -in HuaweiCodeSigningCA.crl -out HuaweiCodeSigningCA.pem

CA文件:

openssl x509 -inform DER -in "Huawei Software Integrity Protection Root CA.der" -out HuaweiRootCA.pem

5. 记事本打开步骤4中的文件,将CRL文件粘贴到CA文件后"HuaweiRootCA.pem"

6.CMS验证

openssl cms -verify -inform DER -crl_check_all -in hmwsdk-win-demo-win32.zip.cms -content hmwsdk-win-demo-win32.zip -CAfile HuaweiRootCA.pem -out cmsVerifiedData -binary -purpose any -certsout tmpCertChain.pem

命令执行结果示例,如下所示表示验签成功:

CMS Verification successful
support.huaweicloud.com/sdkreference-meeting/toctopics/zh-cn_topic_0000001506622076.html