Below is the XML Signature keyinfo I need to generate in Java.
<ds:KeyInfo Id="idhere">
<wsse:SecurityTokenReference wsse11:TokenType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1" wsu:Id="idhere" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd">
<wsse:Reference URI="#X509" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
Below is how far I have got so far in Java. How do I add a Security Token Reference to a Key Info?
KeyInfoFactory kif = fac.getKeyInfoFactory();
KeyInfo ki = kif.newKeyInfo(Collections.singletonList(Whatgoeshere?));
XMLSignature signature = fac.newXMLSignature(si, ki,null,"id-2FC89B275743456788xtdcfyvg9014",null);
Any extra info needed feel free to ask. Thank you!