title: Adding KeyInfo reference in SOAP request
body: <p>So I'm having a very similar issue to this post here. <a href="https://stackoverflow.com/questions/27627648/soap-keyinfo-values">SOAP KeyInfo values</a></p>
  
  <p>I am wanting to add a reference within KeyInfo but can't seem to find a way to do it through code. </p>
  
  <p>Here is what the expected output should be: </p>
  
  <pre><code>&lt;KeyInfo&gt;
      &lt;wsse:SecurityTokenReference&gt;
          &lt;wsse:Reference URI="#SecurityTest" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/&gt;
      &lt;/wsse:SecurityTokenReference&gt;
  &lt;/KeyInfo&gt;
  </code></pre>
  
  <p>And I do have this above where it is trying to reference from: </p>
  
  <pre><code>&lt;wsse:BinarySecurityToken ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" 
          EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" 
          xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
          wsu:Id="SecurityTest"&gt;Base64CertStuffBlahblah
  &lt;/wsse:BinarySecurityToken&gt;
  </code></pre>
  
  <p>Every attempt at creating the KeyInfo portion only allows me to insert an item, like a key, to fill in this part in but I just want a reference. This code is what I've been working with but is not creating what I want at the moment. </p>
  
  <pre><code>//This creates a X509 clause but it's as far as I've got. 
  //The "keyInfoData" needs to be of a different type to allow custom reference?
  var signer = new SignedXmlWithId(doc) {SigningKey = Key};
  KeyInfo keyInfo = new KeyInfo();
  KeyInfoX509Data keyInfoData = new KeyInfoX509Data();
  keyInfoData.AddCertificate(cert);
  keyInfo.AddClause(keyInfoData);
  signer.KeyInfo = keyInfo;
  </code></pre>
  
  <p>Thanks for looking, any help would be appreciated.</p>