SOAP KeyInfo values

2019-06-26 02:58发布

问题:

I am trying to set up my Signature for a SOAP message. The only part I have left is to populate KeyInfo as such:

> <KeyInfo>
>       <wsse:SecurityTokenReference>
>           <wsse:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</wsse:KeyIdentifier>
>       </wsse:SecurityTokenReference>
>     </KeyInfo>

I have tried a number of methods, but I have been unable to achieve this using KeyInfo and KeyInfoFactory.

If this is the wrong way to do it, how do i make sure that KeyInfo is populated as partof my signature?

XMLSignature signature = sigFactory.newXMLSignature(signedinfo,keyinfo)

I am able to add in X509 info, but i do not see a way to add SecurityTokenReference