Subject: howto combine a client signature with a timestamp?

From: Alicia da Conceicao <[email-masked]>
Date: Sat, 4 Sep 2004 05:46:29 -0400 (EDT)

Greetings:

A while back I developed my own TCP based RFC-3161 complient timestamping
client and servers.  Currently I have a pressing need to also timestamp
CMS digital signatures (RFC-3369) as well and archive them with the TSA.
 
Rather then store separate files for the a client's digital signature and 
the TSA timestamp of that signature, it would be ideal to store them both 
in single file.                  
 
Unfortunately, I cannot find any examples on this.  RFC-3161 does recommend
that one place the TSA issued timestamp token inside a client's CMS digital
signature (signed-data) as an unsigned/unauthenticated-attribute within the
client's signer info, using the OID "1.2.840.113549.1.9.16.2.14".

However, if the timestamp is issued for the a client's CMS digital signature
(signed-data) structure, then the timestamp will contain a hash of that
structure without the timestamp token.  So if the timestamp token is appended
to the CMS structure, the CMS structure hash would change and the timestamp
would no longer correspond to it.  It is true that someone with this type of
ugly CMS structure could extract the timestamp, then change many of the DER
lengths in the CMS structure to get the original signature, then compare it
with the extracted timestamp, but this would be a very horrible method.  It
would also be ugly to use BER encoding with arbitary lengths, with CMS
structures that are typically always DER encoded.
 
Is there a better way to do this?  I looked at combining a client's
signerInfo after the TSA signerInfo within the same timestamp, but that might
break a few PKIX standards.      
 
Since timestamping is primarily suited for digital signatures, to prove that
a client's signature was signed at a specified time, someone (hopefully on
this mailing list) must have a generated at least one example.

Does anyone have any DER encoded examples of a combined client's digital
signature with a TSA issued timestamp of that signature, using RSA-SHA1.
If it helps, you can pretend that I have some arbitary Excel spreadsheet
with a SHA1 digest hash of

        01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67

and e-mail a combined DER encoded structure with both the client's digital
signature and TSA issued timestamp of that signature.

Thank you very much in advance for any assistance you can provide.
Alicia.

---

From: "Miguel Rodriguez" <[email-masked]>
Date: Sun, 5 Sep 2004 13:42:08 -0500

Take a look at RFC 3126, it extends CMS to include rfc3161 timestamps.

Regards,

Miguel A Rodriguez
SeguriData
Mexico

> -----Original Message-----
> From: [email-masked] 
> [mailto:[email-masked]] On Behalf Of Alicia da Conceicao
> Sent: Saturday, September 04, 2004 4:46 AM
> To: [email-masked]
> Subject: howto combine a client signature with a timestamp?
> 
> 
> 
> Greetings:
> 
> signature (signed-data) as an 
> unsigned/unauthenticated-attribute within the