|
|
|
@ -45,12 +45,11 @@ public class CertificateManagerUtil {
|
|
|
|
|
|
|
|
|
|
public static Document convertToDocument(File file) throws CertificateManagementException {
|
|
|
|
|
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
|
|
|
|
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
|
|
|
|
|
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
|
|
|
|
|
factory.setNamespaceAware(true);
|
|
|
|
|
try {
|
|
|
|
|
DocumentBuilder docBuilder = factory.newDocumentBuilder();
|
|
|
|
|
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
|
|
|
|
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
|
|
|
|
|
DocumentBuilder docBuilder = factory.newDocumentBuilder();
|
|
|
|
|
return docBuilder.parse(file);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new CertificateManagementException("Error occurred while parsing file, while converting " +
|
|
|
|
|