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

Skip to content

Fixed setting xades signature policy uri when parsing signature structure

Created by: rvillido

This modification fixes setting signature policy URI to XAdES signature object when parsing and validating XAdES signature structure.

The element that is included in parsing XAdES signature is SPURI within the signature policy ID element (all other elements are already being properly parsed): SignaturePolicyId/SigPolicyQualifiers/SigPolicyQualifier/SPURI

<xades:SignedSignatureProperties>
  <xades:SignaturePolicyIdentifier>
    <xades:SignaturePolicyId>
      <xades:SigPolicyQualifiers>
        <xades:SigPolicyQualifier>
          <xades:SPURI>http://spuri.test</xades:SPURI>
        </xades:SigPolicyQualifier>
      </xades:SigPolicyQualifiers>
    </xades:SignaturePolicyId>
  </xades:SignaturePolicyIdentifier>
</xades:SignedSignatureProperties>

As a TDD enthusiast, I added a unit test so it would be visible what got fixed. The following line of code tests the modification:

assertEquals(POLICY_URL, policy.getUrl());

Merge request reports