Uploaded image for project: 'Santuario'
  1. Santuario
  2. SANTUARIO-468

How to add generated signature element deep inside desired tag in XML through stax implementation

    XMLWordPrintableJSON

    Details

    • Type: Wish
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Java 2.0.8
    • Fix Version/s: Java 2.1.1, Java 2.0.10
    • Component/s: Java
    • Labels:
      None

      Description

      I am using the Santuario Stax 2.0.8 for signing the xml payment message.
      Currently setSignaturePosition add the generated signature element into the first node depth only not deeper inside in xml structure and also not the inside element it add just after the element(based on given position)

      For example below - how stax implementation will add the generated signature element inside the below tag given in the xml sample below.
      <tag11>
      <!-- I am expecting the generated signature element here -->
      </tag11>

      XMLSecurityProperties properties = new XMLSecurityProperties();
      properties.setSignaturePosition(1); //any number
      
      <message>
         <!-- properties.setSignaturePosition(0) is adding the signature element here -->
      	<tag1>
      		<tag11>
      		  <!-- I am expecting the generated signature element here -->
      		</tag11>
      	</tag1>
      	<!-- properties.setSignaturePosition(1) is adding the signature element here just after the first tag:tag1-->
      	<tag2>
      	</tag2>
      	<!-- properties.setSignaturePosition(2) is adding the signature element here just after the first tag:tag2-->
      	<tag3>
      	</tag3>
      	<tag4>
      	</tag4>
      	
      	<!-- properties.setSignaturePosition(10) is adding the signature element here last in the file -->
      </message>
      

      Can we achieve this in the xmlsec-2.0.8 stax ?

      Thanks,
      Manjesh

        Attachments

        1. XMLSecurityProperties.java
          17 kB
          Manjesh Kumar
        2. XMLSignatureEndingOutputProcessor.java
          9 kB
          Manjesh Kumar

          Activity

            People

            • Assignee:
              coheigea Colm O hEigeartaigh
              Reporter:
              manjeshk Manjesh Kumar
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: