Erivaldo Josué
Erivaldo Josué

Reputation: 1

Add content to PKCS7 detached signature

I have a content application that stores PKCS7 detached signatures in a database and the original file on the disk. Now I'll have to send an unique file to a customer containing the original document and the signature, as it if were signed attached. Note that the document hasn't been and won't be encrypted. Does someone knows how to do it, programmaticaly (in .Net, Java, ...) or with a command line tool?

Thanks.

Upvotes: 0

Views: 2623

Answers (2)

caf
caf

Reputation: 239031

The S/MIME specification shows how you can take a detached PKCS #7 signature and a cleartext document and combine them into one multipart MIME message.

Upvotes: 1

President James K. Polk
President James K. Polk

Reputation: 41967

The book "Beginning Cryptography With Java" comes with examples which you can download for free here. In the chapter 9 folder is an example called SignedDataExample.java that might help.

Upvotes: 2

Related Questions