I have some questions about signed XML, specifically regarding 
Draft 07-December-1999,  
http://www.w3.org/Signature/Drafts/WD-xmldsig-core-19991207.html

I have created an example where a transaction is to be signed, and the
signature to be transported with the transaction. I also assume that
the signature should cover the transaction, and a timestamp,
and that X.509 certificates should be included in the transaction.

My questions refer to the sample which follows the questions.

1. If I wish to not include the OBJECT elements themselves in the signature for
the transaction, is the example xpath transform below correct? If so, what
does the draft mean in section 5.6.3 (Xpath filtering) that the root
should be included so the result is well-formed? I thought I only want
to sign the contents of the referenced object element. Is there an
example available?

2. For KeyInfo, KeyData, Is it correct to assume a CERTIFICATE element
for each certificate in the signing party certificate chain? Is it
correct to specify the encoding for each as an attribute of the
certificate element?  

I am assuming that each certificate is base64 encoded (encoding type)
of the DER encoding.

3. I assume that X.509 oids are not used since they are implicit in an
XML element. Thus for example, if the signer sends device specific
information as part of signing, the OID for this information would be
implicit. Thus if in ASN.1 it is AUTHINFO and an OID, the tag
SignerDeviceInfo would be enough - if the recipient knows to map this
to the OID. (I guess I'm asking and assuming OID mapping is
application dependent). 

4. In section 3.4, KeyInfo, I note that the spec allows including a
CRL, with element X509CRL. Can we also define including signed OCSP
responses, with an X509OCSP element? This would allow transmitted the
status of the certs with a transaction in an interoperable manner. 

5. What is the relationship between SignatureAttribute object types
and SignatureProperties elements, and when is either necessary?

How is the optional type in an ObjectReference element used?
(section 3.3.3). Does it matter if I have it or not? It seems not to
matter. (e.g. <Object ID="timestamp"
	      type="&dsig;/SignatureAttributes">
vs <Object ID="txn">
Should all signature attribute objects be within SignatureProperties
elements? I'm a little confused because it looks like properties of
the signature (e.g. signing time) belong in SignatureProperties, but
that is not how example 8.0 works. Is there a guideline?

6. Likewise in the ObjectReference section 3.3.3, I'm not clear what a
"parent document" is when using the null URL. Does this mean the root
of the current document or something else?

7. The difference between SignedInfo, Manifest and Package is (to restate)
SignedInfo - each digest must be validated
Manifest - each digest may be validated
Package - each referenced object should be the same after transforms
are applied (e.g. this is like mirrors for the reference info)

A package may be used as a Object reference within a SignedInfo or
Manifest, but then  only the digest of the manifest (and not the
content itself is signed. 

8. I might suggest adding in the security section (section 7), that in
the X.509 case, the security also depends on the validity of the signers
certificate chain, and that if any private key has been compromised the
document signature is not dependable, so signature validation may only
be the first step in a process to reduce the risk of depending on the document.

9. Section 1.3 refers to the XML namespace xmldsig-core, but the other
namespaces (e.g. SHA1) include dsig-core. Are they intentionally different?

thanks


<!-- digest and certificate values are placeholders -->
<signature>

<SignedInfo>
	<CanonicalizationMethod Algorithm="&dsig;/minimal"/>

	<signatureMethod Algorithm="&dsig;/rsa-sha1"/>
	<ObjectReference IDREF="txn">
		<Transforms>
			<Transform Algorithm="http://www.w3.org/TR/1999/PR-xpath-19991008">
			//object[@id="txn"]/child::node()
			</Transform>
		</Transforms>
		<DigestMethod Algorithm="&dsig;/sha1"/>
		<DigestValue encoding="&dsig;/base64">abc</DigestValue>
	</ObjectReference>
</SignedInfo>

<SignatureValue>ghi</SignatureValue>

<KeyInfo>
	<X509Data>
		<X509IssuerSerial>
			<X509Name>DN</X509Name>
			<X509SerialNumber>SN</X509SerialNumber>
		</X509IssuerSerial>
<!-- certificate chain -->
<!-- each cert is an X.509 format cert using ASN.1, base64 encoded -->
		<X509Certificate encoding="&dsig;/base64">
		a1b1
		</X509Certificate>
		<X509Certificate encoding="&dsig;/base64">
		c1d1
		</X509Certificate>
		<X509Certificate encoding="&dsig;/base64">
		e1f1
		</X509Certificate>
	</X509Data>
</KeyInfo>

<Object ID="txn" >
	<txn xmls="http://www.myorg.com/txn.txt">
		<title>This is the content of the transaction</title>
		<body>It is structured as XML according to the txn
                      schema</body> 
	</txn>
</Object>

<Object ID="timestamp" type="&dsig;/SignatureAttributes">
	<timestamp about="5" xmls="http://www.ietf.org/rfcXXXX.txt">
	<date>19990908</date>
	<time>14:34:34:34</time>
	</timestamp>
</Object>

<Object ID="signerDeviceInfo" encoding="&dsig;/base64" type="&dsig;/SignatureAttributes">
abcd
</Object>

</signature>


