用私钥签名,生成签名文件:
openssl smime -sign -inkey private.key -signer public.crt -in test.txt -out test.signed.txt
用公钥验证签名文件:
openssl smime -verify -in test.signed.txt -signer public.crt -out test.txt -CAfile RootCA.crt #成功显示 Verification successful #失败显示 Verification failure