【OpenSSL】SMIME Group Message

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 "/[email protected]" -out alicecsr.pem
openssl 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

你可能感兴趣的:(cms,OpenSSL,smime)