开发者

Digitally sign email in Ruby with S/MIME

开发者 https://www.devze.com 2022-12-26 02:44 出处:网络
Is there a way in Ruby to digitally sign email messages with S/MIME?Our group uses PKI and our users are conditioned to expect digital signatures for important messages.

Is there a way in Ruby to digitally sign email messages with S/MIME? Our group uses PKI and our users are conditioned to expect digital signatures for important messages.

I know I can invoke the openssl command line tool:

openssl smime -sign -signer $CERT_FILE -passin pass:$CERT_PASS
  -in $UNSIGNED_MAIL -out $SIGNED_MAIL 开发者_JS百科-certfile $CERT_CA_FILE
  -from 'your ' -to 'recipients <email@address>'
  -subject 'The Subject'

but I am hoping to utilize a Ruby solution.


I ended up using the above solution, but for those in a similar situation, you have to convert the PKI key (in .p12 file format) first: openssl pkcs12 -in #{@cert_file} -passin pass:#{@pass_phrase} -passout pass:#{@pass_phrase} -out #{out_file}

0

精彩评论

暂无评论...
验证码 换一张
取 消