When signed data is packaged as PKCS#7, what all content PKCS#7 could be there(Ex. certificates, signature, etc.)? And what are the purpose of packaging all those contents?


You can embed any data within a PKCS#7/CMS structure. The Cryptographic Message Syntax (which is the new name for PKCS#7) knows the types EnvelopedData for encrypted data and AuthenticatedData for signed/MACed data.

That way, you can create an enveloping signature, thus storing the signature and the signed data in a single file even when the format of your data does not support it.

  • When I sign a data and package it as PKCS#7 file, what all data should be there? and what is the reason behind it? – susthan Apr 7 '17 at 4:04
  • It it optional, if you actually do it, is up to the requirements of your application. As I wrote in my answer: You might want to do it, if you do not want to have a detached signature (a signature in a seperate file), but your file type does not allow to embed a signature directly. – mat Apr 7 '17 at 6:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.