title: Security header generation using WSSecSignature
body: <p>I'm using <code>WSSecSignature</code> to generate security header here is the code for that.</p>
  
  <pre><code>public static SOAPMessage signSoapMessage1(SOAPMessage message, PrivateKey signingKey, X509Certificate signingCert, char[] password) throws WSSecurityException {
      final String alias = "alias";
      WSSConfig config = new WSSConfig();
      config.setWsiBSPCompliant(false);
      WSSecSignature builder = new WSSecSignature();
      builder.setX509Certificate(signingCert);
      builder.setUserInfo(alias, new String(password));
      builder.setUseSingleCertificate(false);
      builder.setKeyIdentifierType(WSConstants.BST);
      builder.setSigCanonicalization(WSConstants.C14N_EXCL_OMIT_COMMENTS);
      try {
          Document document = toDocument(message);
          WSSecHeader secHeader = new WSSecHeader();
          secHeader.insertSecurityHeader(document);
          List&lt;WSEncryptionPart&gt; parts = new ArrayList&lt;WSEncryptionPart&gt;();
          WSEncryptionPart bodyPart = new WSEncryptionPart(WSConstants.ELEM_BODY, WSConstants.URI_SOAP11_ENV, "");
          parts.add(bodyPart);
          builder.setParts(parts);
          Properties properties = new Properties();
          properties.setProperty("org.apache.ws.security.crypto.provider", "org.apache.ws.security.components.crypto.Merlin");
          Crypto crypto = CryptoFactory.getInstance(properties);
          KeyStore keystore = KeyStore.getInstance("PKCS12");
          FileInputStream fis = new FileInputStream("certFile.p12");
          InputStream is = fis;
          keystore.load(is, password);
          ((Merlin) crypto).setKeyStore(keystore);
          crypto.loadCertificate(new ByteArrayInputStream(signingCert.getEncoded()));
          document = builder.build(document, crypto, secHeader);
          System.out.println(docToString(document));
          return message;
      } catch (Exception e) {
          e.printStackTrace();
          return null;
      }
  }
  </code></pre>
  
  <p>In this, what is the significance of <code>builder.setUseSingleCertificate(false);</code> I tried giving <code>true</code> and <code>false</code>, but there is no change I could find.</p>
  
  <p>Pardon me if my understanding is wrong.</p>