【OpenSSL】SMIME Group Message

来源:互联网 发布:linux重启mysql数据库 编辑:程序博客网 时间:2024/05/01 18:52

Introduction

  • Here GroupMessage means that a message is sent to a group of recipients.

Prepare certificates

  • Alice
openssl genrsa -out alicekey.pem openssl req -new -key alicekey.pem -sujb "/emailAddress=alice@x.com" -out alicecsr.pemopenssl x509 -req -in alicecsr.pem -days 999 -signkey alicekey.pem -out alicecert.pem
  • Bob
    Skipped

  • Cat
    Skipped

Sample Steps

Signing

openssl cms -sign -in msg.txt -signer alicecert.pem -inkey alicekey.pem -nodetach -text 

Encrypting

openssl cms -encrypt -des3 bobcert.pem catcert.pem  

Decrypting with Bob key

openssl cms -decrypt -recip bobcert.pem -inkey bobkey.pem 

Decrypting with Cat key

openssl cms -decrypt -recip catcert.pem -inkey catkey.pem 

Verifying with Alice certificate

openssl cms -verify -certfile alicecert.pem -CAfile alicecert.pem

Note

0 0
原创粉丝点击