Hi all,

 

We’re using XML digital signatures from the XML Digital Signatures specification. It’s common for a signature to be enveloped in another documents, as shown in this example

 

<Example>

            <ds:Signature xmlns:ds=”http:/…”>

            …..

            </ds:Signature>

</Example>

 

We have compiled the XML Signature Specification schema, so the SchemaTypeSystem is aware from it, creating a SignatureDocument and a SignatureType.  As we’re in a client/server environment, we don’t know which documents the client are going to send to us for signing, and, because of that, we don’t have any schemas of <Example> documents (sometimes these schemas doesn’t exist).

 

In fact, we don’t need the schema as long as there’s no need for knowing some <Example> details (i.e. getting access to the xs:ID attributes), as our processing of the outer document deals mainly with the DOM / Cursor views.

 

When we try to obtain a signature, we observe the following behaviour

1)       If <Example>’s schema  is compiled, we can access to the Signature node(i.e. via XPath) and XMLBeans sees it normally as a SignatureType.

2)       If <Example>’s schema is not compiled, we obtain XmlAnyTypeImpl’s for every object in the tree (even the ones that are known)

a.       If we position (i.e. Cursor / XPath) in the signature node and execute a XMLObject.changeType(SignatureDocument.type) or XMLObject.changeType(SignatureType.type) (the last one (changetype with elements) not implemented, as shown in the JIRA Case), we get again an XmlAnyTypeImpl (no effect). The changeType with the document is not working.

b.       The only way we’ve observed is reparsing the document from the <ds:Signature> node, and, in that case, we get two disconnected documents (that’s unacceptable for us as we need to have the whole doc).

c.       When there’s a node in the traversal of the tree not known for XmlBeans(the starting one or one intermediate), the inner nodes in the tree are always XmlAnyTypeImpl (both when the following nodes are known and not known (obviously, the latter case is ok)). Thus, when XmlBeans find an unknown node, there’s no further analysis down the tree.

 

How can we obtain the correct SignatureType / SignatureDocument?.

 

Thank you very much in advance,

 

Carlos

 

Carlos González-Cadenas
Director Tècnic, DirecTrust
Technical Director, DirecTrust


netfocus
Diagonal 188-198 Planta 2
08018 Barcelona
tel: 902 303 393
fax: 902 303 394
[EMAIL PROTECTED]
www.netfocus.es

 

Reply via email to