Re: Multiple enveloped signatures

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jirka

Apologies, your message got lost during the holidays.

It is certainly possible and 'correct' to use enveloped signatures as you suggest, and correct to have multiple enveloped signatures in one document.

To verify  you have to exclude all the signatures when validating one of the signatures (unless you have counter-signatures) - thus it requires more work than if the signatures are detached (but easier to correlate and transfer as part of the document).

Thus the signature has to explicitly exclude the other signatures, this can be done for example using enveloped signature transforms.

Alternatively, and probably safer is to explicitly reference elements of the invoice that should be signed. If this is done for children of the invoice element, then the signature children will not be included. This should work if your invoice has  a structure with a few child elements of the invoice element, and you can reference each by XPath or id. (Care needs to be taken regarding wrapping attacks however).

Another equivalent approach is to define <signedInvoice> that has an invoice and 1+ signature children, each of which reference the invoice. 

What I am suggesting is that you can simplify the processing if you define the structure to take into account signatures as well as the content to be signed.

Does this make sense?

regards, Frederick

Frederick Hirsch
Nokia



On Dec 17, 2012, at 10:04 AM, ext Jirka Kosek wrote:

> Hi,
> 
> during developing Czech XML based invoicing standard we crossed issue of
> several signatures attached to one document and even after studying all
> specifications related to XML DSig we are not sure what is the right
> answer to our problem.
> 
> Initially we need to solve simple problem of attaching one signature and
> thus many implementors used Enveloped Signature as it was easiest one to
> incorporate into existing document.
> 
> However after some time there was demand for multiple signatures -- for
> example invoice has to be approved by several people, so each person
> attached his signature. Many implementations used enveloped signature
> for this as well. So typical document looked like:
> 
> <Invoice>
>  ... invoice content ...
>  <dsig:Signature>1st signature</dsig:Signature>
>  <dsig:Signature>2nd signature</dsig:Signature>
>  <dsig:Signature>3rd signature</dsig:Signature>
> </Invoice>
> 
> As all signatures were created as enveloped ones validation has always
> been done from the end. After validating 3rd signature, the signature
> was removed and 2nd signature was validated. Then 2nd signature was
> removed and 1st signature was validated, etc.
> 
> However such approach doesn't allow to validate 1st (or 2nd) signature
> alone without removing 2nd and 3rd signatures first as they are
> considered a part of signed content (<Reference URI=""> is used for
> enveloped signature).
> 
> So my questions (to which I haven't found answer in any REC, WD or BP
> document) are:
> 
> -- is it correct to attach multiple enveloped signatures to one document?
> 
> -- is there somewhere definition of process used for validation of
> document with several enveloped signatures?
> 
> -- if it's incorrect to attach multiple enveloped signatures to one
> document where this is defined?
> 
> Thanks for insights in advance.
> 
> 					Jirka
> 
> 
> -- 
> ------------------------------------------------------------------
>  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
> ------------------------------------------------------------------
>       Professional XML consulting and training services
>  DocBook customization, custom XSLT/XSL-FO document processing
> ------------------------------------------------------------------
> OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
> ------------------------------------------------------------------
>    Bringing you XML Prague conference    http://xmlprague.cz
> ------------------------------------------------------------------
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org

iQIcBAEBAgAGBQJQ6z7QAAoJEKLkrjd6EWMnPUkP+wTTwYJXOlC7hvXw44pMo8Mn
WJUoJsyaCVJWPVQUoKdSJYtTUsbpBhijKH5dHOvMxFPGguX0HurpiQdAjXARBqM6
tJV2X3FlrvOnKITlhNEcF4zcZaOONCczyrMYibIgh9qZKXcXW0NXn4khEW48HRqY
3KYQW/ZgDJN/IcPvVWpl6JPN/La1aQbRbkRpEdMXXH+h0LUwTdFSQ0yV7qLfCQ2S
+i3n1fOfr8owHy0UrFHMe5n8zDV+3sGBGHc6yN5TSZI/xB4y47bLVh6B7u+HbuN1
NLGlndItiT8CCEDLIjr4Nz0b3LhwDFwv0q1WIqqoO8xs7gRcqIkuIoYNSiCLmVGy
uWd9x7/OQJ+ormRFwUsNnADULKhKFc0UFZCZtOXWdok/fyyD/5InJyrv2jXIlkVr
FpyVI6ke248s3lIq7TqvpAhVnI5QC7+XVqZ3hCkgnG3N/Ovmm9DEnr9iN2tzfBpa
s9FzAk9vFP2zkGzMmMED6WfhEKPutA1BV/LZG4Gnw4Wt3FxHmo1RBvpNxYtSLCpZ
xY4hp/MUXasBd1AwIgUuUAdDyNd+T1RQ2Rx8aXPrhG6SYB+dLCMk/N/5nil9csrI
wX9ra+IpAxfZAII3uUWQcweJCNAQmn4TYOIyIRjLT8LQ7XaekVapLiDOdjokyvNM
WrB0QJFGunFR0Y3d2KLw
=KMIH
-----END PGP SIGNATURE-----

Received on Monday, 7 January 2013 21:32:39 UTC