sign.prepare(doc, null, reqData.getSecHeader());
// prepend in this order: first the Signature Element and then the
// UsernameToken Element. This way the server gets the UsernameToken
// first, can check it and are prepared to compute the Signature key.
sign.prependToHeader(reqData.getSecHeader());
builder.prependToHeader(reqData.getSecHeader());
Vector parts = null;
if (reqData.getSignatureParts().size() > 0) {
parts = reqData.getSignatureParts();