Using CryptSignMessage to insert timestamp into PDF



Hello!

I am signing PDF files using a PKCS#7 signature created with
CryptSignMessage from Microsoft CryptoAPI. It works. But I'd like to
add a timestamp (from a TSA server) to my signature.
The PDF reference and RFC 3161 say I must add it as an "unauthenticated
attribute" (although someone told me it should be "authenticated"),
with the Object ID "1.2.840.113549.1.9.16.2.14".
My questions :
.. can anyone confirm if it should be an "authenticated" or
"unauthenticated" attribute?
.. what is the data that I must insert into this attribute? I tried
inserting the data returned by the time server (the "TimeStampResp"),
and I also tried to insert the "TimeStampToken", that I retrieve from
the "TimeStampResp" by removing the first bytes (corresponding to the
"PKIStatusInfo")... Nothing seems to work. This data returned by the
time server is already ASN1 DER-encoded. I don't need to "CryptEncode"
it... do I? (If I do, what is the structure type I should use?)
.. if I did right, then, what is wrong? Maybe the hash that I send to
the time server? It is the hash of the byte range of the PDF file, the
same hash as for the signature, right? (Because I want to certify the
PDF file was created before this date, not the signature)...
I think I am close to the solution, but it still doesn't work, it's
frustrating!
Thanks for your help!

Alain.

.



Relevant Pages

  • Using CryptSignMessage to insert timestamp into PDF
    ... add a timestamp to my signature. ... time server is already ASN1 DER-encoded. ... PDF file was created before this date, ...
    (comp.text.pdf)
  • Re: Using CryptSignMessage to insert timestamp into PDF
    ... Since a timestamp service is really a counter-signature on your already ... At least that is how the Authenticode signed PE time-stamping works. ... time server is already ASN1 DER-encoded. ... PDF file was created before this date, ...
    (microsoft.public.platformsdk.security)
  • Re: Signature capture into our web-based Java app?
    ... capture a signature into our Java app in some usable format? ... generate a PDF file in a specific format off that input data. ... Which hardware device exactly? ... The only 'hardware device' suitable for accepting a signature ...
    (comp.lang.java.programmer)
  • Re: Data Capture using Word on PPC
    ... Please see my signature for our web site and my email address. ... currently save as a pdf file on the PPC, but I appreciate it may need to ... If I create a form/ tempate with the neccessary fields to gather the ... will it work when sent across to the PPC ...
    (microsoft.public.pocketpc)
  • Timestamping and the "/M" key ot the Signature object
    ... I am trying to add a time stamp into a PDF file that I create ... Signature object. ...
    (comp.text.pdf)