addDocuments(sig, documentsList);
customizeToRole(role);
//Adding signature properties
SignatureProperty profile = new SignatureProperty(doc, target,
SignerConstants.SIGNATURE_PROPERTY_ID_PROFILE);
Element profileElement = doc
.createElement(SignerConstants.SIGNATURE_PROPERTY_ID_PROFILE_TAG_NAME);
profileElement.setAttribute("URI", SignerConstants.PROFILE_URI);
profile.appendChild(profileElement);
SignatureProperty role = new SignatureProperty(doc, target,
SignerConstants.SIGNATURE_PROPERTY_ID_ROLE);
Element roleElement = doc
.createElement(SignerConstants.SIGNATURE_PROPERTY_ID_ROLE_TAG_NAME);
roleElement.setAttribute("URI", roleURI);
role.appendChild(roleElement);
SignatureProperty identifier = new SignatureProperty(doc, target,
SignerConstants.SIGNATURE_PROPERTY_ID_IDENTIFIER);
Element identifierElement = doc
.createElement(SignerConstants.SIGNATURE_PROPERTY_ID_IDENTIFIER_TAG_NAME);
identifierElement.setTextContent(name);
identifier.appendChild(identifierElement);
SignatureProperties props = new SignatureProperties(doc);
props.setXPathNamespaceContext(SignerConstants.XMLNS_DSP,
SignerConstants.SIGNATURE_PROPERTIES_NAMESPACE);