创建S / MIME证书

时间:2014-07-24 17:06:01

标签: openssl certificate x509certificate mime smime

我正在尝试使用此处提供的解决方案生成S / MIME证书: https://serverfault.com/questions/103263/can-i-create-my-own-s-mime-certificate-for-email-encryption 解决方案:

openssl genrsa -des3 -out smime.key 4096
openssl req -new -key smime.key -out smime.csr
openssl x509 -req -days 365 -in smime.csr -CA ca.crt -CAkey ca.key -set_serial 1 -out smime.crt -setalias "Self Signed SMIME" -addtrust emailProtection -addreject clientAuth -addreject serverAuth -trustout
openssl pkcs12 -export -in smime.crt -inkey smime.key -out smime.p12

我也想提供签名mime数据的凭据。我怎么可能这样做? 任何帮助都会非常感激。

1 个答案:

答案 0 :(得分:3)

您已经在前三个命令中创建了用于签名MIME的凭据。您可以使用text_to_sign.txtsmime.key

对某些smime.crt文件进行签名
openssl smime -sign -in text_to_sign.txt -inkey smime.key -signer smime.crt