0

I have a requirement in java to digital sign the SOAP Body XML content and have decided to implement it using Apache Santuario library. The following libraries are in use.

wss4j-2.1.jar
xalan-2.7.2.jar
xmlsec-1.5.8.jar

The resultant SOAP Header should contain KeyInfo with following Secutiry elements.

<KeyInfo>
   <SecurityTokenReference>
     <X509Data>
       <X509IssuerSerial>
          <X509IssuerName>value</X509IssuerName>
          <X509SerialNumber>value</X509SerialNumber>
       </X509IssuerSerial>
     </X509Data>
   </SecurityTokenReference>
 </KeyInfo>

But this api allows me to set X509Data part only under KeyInfo not directly inside SecurityTokenReference.

Please help me on how to achieve the same.

regards,

venkatram

VenkatRam
  • 51
  • 3
  • 11

1 Answers1

0

Look at the WSS4J unit tests, that do just that. For example:

https://svn.apache.org/repos/asf/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureTest.java

Colm.

Colm O hEigeartaigh
  • 1,882
  • 1
  • 12
  • 7