Code development platform for open source projects from the European Union institutions

Skip to content

Feature: Signature placement in XAdES according to OASIS DSS standard

Created by: SebastianSchuberth

In the OASIS Digital Signature Service Protocol there is a component called SignaturePlacement (chapter 4.4.18). It is used to request an enveloped XAdES signature for a document with the option to add an XPath to specify where the signature element is to appear within the signed document. So far this is supported by DSS. However, SignaturePlacement further distinguishes between two cases, namely "XPathAfter" and "XPathFirstChildOf". Depending on which is used the signed document should look different for the same XPath. For the first case, the signature element should appear as next sibling of the element referenced by the XPath, whereas for the second it should be inserted as its first child. Currently DSS inserts the signature DOM as last child by default. This pull request implements the necessary changes to support the two cases above depending on a user provided parameter and falls back to the current DSS implementation if no specific XPathElementPlacement is requested. Tests for all three options have also been added.

Merge request reports