[Extensibility Request] Expose SignedXml Reference.Type
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 3d 26m
- Merged PRs (30d)
- 633
Description
Describe the issue
The System Application SignedXml codeunit exposes most of the functionality required to construct XML Digital Signatures, including references, digest methods, transforms, XML objects, and signature computation.
However, there is currently no public API to set the Type attribute of a ds:Reference.
This prevents extensions from producing standards-compliant signatures for formats that require a typed reference.
A concrete example is XAdES. A reference protecting xades:SignedProperties must identify the referenced data as SignedProperties using:
Type="http://uri.etsi.org/01903#SignedProperties"
Business Central currently allows the reference URI, digest algorithm, transforms, etc. to be configured, but not the Type attribute.
As a result, almost all of the required XAdES structure can be constructed using the existing SignedXml API, but the resulting signature cannot be made compliant because this standard ds:Reference property is inaccessible.
Expected behavior
SignedXml should expose a way to set the Type property on a reference before it is added to the signature.
For example, conceptually:
SignedXml.SetReferenceType(Type: Text);
or another API consistent with the existing reference initialization/configuration methods.
The implementation does not need to contain any XAdES-specific logic. It only needs to expose the standard XMLDSIG Reference.Type property.
Steps to reproduce
-
Create an
XmlDocument. -
Initialize
SignedXmlwith the document. -
Initialize a reference using the existing
InitializeReferenceAPI. -
Configure the URI, digest method, and required transforms.
-
Attempt to create a reference with:
Type="http://uri.etsi.org/01903#SignedProperties" -
Observe that the public
SignedXmlAPI provides no method to set theReference.Typevalue.
This prevents creation of a standards-compliant XAdES SignedProperties reference.
Additional context
The issue is not specific to XAdES.
Type is a standard property of an XMLDSIG Reference, and exposing it would make the current SignedXml wrapper more complete without introducing application-specific behavior.
Our immediate use case is implementing generic AdES digital-signature support in AL, including XAdES creation.
We are also preparing a broader proposal for reusable CAdES/XAdES support in System Application, but this issue is independently useful as a small missing piece of the existing SignedXml public API.
We would be willing to contribute the change and tests if appropriate.
I will provide a fix for a bug
- I will provide a fix for a bug
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the System Application SignedXml codeunit and its InitializeReference API, then inspect how Reference properties are exposed and covered by tests. Done means extensions can set a reference Type before adding it to the signature, including the XAdES SignedProperties URI, with test coverage for the exposed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- xml
- Domain
- api, security
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100