Java XML WS-Security Signature; X.509 Token Profile; adding a Security Token Reference
<p>Below is the XML Signature keyinfo I need to generate in Java.</p>

<pre><code>&lt;ds:KeyInfo Id="idhere"&gt;
&lt;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"&gt;
&lt;wsse:Reference URI="#X509" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"/&gt;
                    &lt;/wsse:SecurityTokenReference&gt;
                &lt;/ds:KeyInfo&gt;
</code></pre>

<p>Below is how far I have got so far in Java. How do I add a Security Token Reference to a Key Info?</p>

<pre><code>KeyInfoFactory kif = fac.getKeyInfoFactory(); 

KeyInfo ki = kif.newKeyInfo(Collections.singletonList(Whatgoeshere?));  


XMLSignature signature = fac.newXMLSignature(si, ki,null,"id-2FC89B275743456788xtdcfyvg9014",null);
</code></pre>

<p>Any extra info needed feel free to ask. Thank you!</p>