Pkcs7 Timestamped

I’ve been looking at him all day, and I'm still puzzled. I want to add a digital signature to a timestamped PDF from TSA (TimeStamp Authority).

I agree to send the request to TSA and receive a binary response, but how to add this timestamp to my pkcs7 digital signature.

I am using PHP with TCPDF and the openssl_pkcs7_sign() function. Do I need to add a timestamp as an additional certificate? Thanks!

+4
source share
2 answers

I created a simple phpcmstimestamper library project for this purpose, and you can use it as follows:

 <?php $originalCmsAsPem = "-----BEGIN CMS----- MIIFiAYJKoZIhvcNAQcCoIIFeTCCBXUCAQExDTALBglghkgBZQMEAgEwHQYJKoZI ... 1lUaWopfF7uZf5LXZt2Ru5UPr+51ULJRcEeUTA== -----END CMS-----"; $updatedCms = CmsTimestamper::addTimestampToCms($originalCmsAsPem, "http://tsa.starfieldtech.com"); 

You can get more detailed information and a fully working example at https://github.com/hablutzel1/phpcmstimestamper .

0
source

With PHP is impossible, I'm afraid. I would do it server side pkcs # 7 on a C ++ server.

-1
source

All Articles