1,通信双方的证书生成
1.1生成根节点证书
openssl genrsa -out cakey.pem 2048
继续阅读“OpenSSL使用S/MIME发送签名和加密邮件”xuenhua’s 站点
openssl x509 -inform der -in certificate.cer -out certificate.pem
openssl pkcs12 -in keyStore.pfx -out keyStore.pem -nodes
-nocerts #不含证书
-nokeys #不含私钥
openssl smime -encrypt -subject “test email” -in ./txt.txt -to shoujianren@126.com -from fajianren@163.com -out ./msg.eml shoujianren.pem
openssl smime -decrypt -in msg.eml -recip shoujianren.pem -inkey shoujianren.pem -out out.eml
openssl smime -verify -noverify -in out.eml -certfile fajianren.pem