title: java - Apache CXF add signing certificate as BinarySecurityToken into WS-security header
body: <p>I'm consuming WSDL and I need to sign the Timestamp and SOAP-body using my client certificate when making SOAP requests.</p>
  
  <p>My signing-certificate has to be represented as BinarySecurityToken in the message and be included in SOAP header like this:</p>
  
  <pre><code>&lt;wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soap:mustUnderstand="true"&gt;
          &lt;wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs
  .oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="X509-15730854BE4465A46D14538884282111"&gt;MIIFO.......56Q==&lt;/wss
  e:BinarySecurityToken&gt;
          &lt;wsu:Timestamp wsu:Id="TS-1"&gt;
              &lt;wsu:Created&gt;2016-03-16T09:53:48.201Z&lt;/wsu:Created&gt;
              &lt;wsu:Expires&gt;2016-03-16T09:58:48.201Z&lt;/wsu:Expires&gt;
          &lt;/wsu:Timestamp&gt;
          .......
  </code></pre>
  
  <p>I'm using WSS4JOutInterceptor to customize my request, but can't find a way how to include my signing certificate into the request:</p>
  
  <pre><code>// for outgoing messages: Signature and Timestamp validation
          outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE + " " + WSHandlerConstants.TIMESTAMP);
          outProps.put(WSHandlerConstants.USER, "sss");
          outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, ClientKeystorePasswordCallbackHandler.class.getName());
          outProps.put(WSHandlerConstants.SIG_PROP_FILE, "client_sec.properties");
          outProps.put(WSHandlerConstants.SIG_KEY_ID, "X509KeyIdentifier");
          outProps.put(WSHandlerConstants.SIGNATURE_PARTS, "{}{http://schemas.xmlsoap.org/soap/envelope/}Body;{}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp}");
  </code></pre>
  
  <p>Can anyone suggest me how to do it?</p>