}
if (signatureToken == null) {
signatureToken = reqData.getSignatureToken();
}
WSPasswordCallback passwordCallback =
handler.getPasswordCB(signatureToken.getUser(), WSConstants.SIGN, callbackHandler, reqData);
WSSecSignature wsSign = new WSSecSignature(reqData.getWssConfig());
if (signatureToken.getKeyIdentifierId() != 0) {
wsSign.setKeyIdentifierType(signatureToken.getKeyIdentifierId());
}
if (signatureToken.getSignatureAlgorithm() != null) {
wsSign.setSignatureAlgorithm(signatureToken.getSignatureAlgorithm());
}
if (signatureToken.getDigestAlgorithm() != null) {
wsSign.setDigestAlgo(signatureToken.getDigestAlgorithm());
}
if (signatureToken.getC14nAlgorithm() != null) {
wsSign.setSigCanonicalization(signatureToken.getC14nAlgorithm());
}
wsSign.setIncludeSignatureToken(signatureToken.isIncludeSignatureToken());
wsSign.setUserInfo(signatureToken.getUser(), passwordCallback.getPassword());
wsSign.setUseSingleCertificate(signatureToken.isUseSingleCert());
if (passwordCallback.getKey() != null) {
wsSign.setSecretKey(passwordCallback.getKey());
} else if (signatureToken.getKey() != null) {
wsSign.setSecretKey(signatureToken.getKey());
}
if (signatureToken.getTokenId() != null) {