/** * @return the {@code List} of signature id(s) contained in the simpleReport */ public List<String> getSignatureIdList() { final List<String> signatureIdList = new ArrayList<String>(); final List<XmlDom> signatures = getElements("/SimpleReport/Signature"); for (final XmlDom signature : signatures) { signatureIdList.add(signature.getAttribute("Id")); } return signatureIdList; }
/** * @return the list of signature id contained in the simpleReport * @deprecated FROM 4.3.0-RC, use getSignatureIdList() */ @Deprecated public List<String> getSignatureIds() { final List<String> signatureIdList = new ArrayList<String>(); final List<XmlDom> signatures = getElements("/SimpleReport/Signature"); for (final XmlDom signature : signatures) { signatureIdList.add(signature.getAttribute("Id")); } return signatureIdList; }
/** * This method returns the {@code List} of {@code String} id based on the given XPath query and set of optional parameters. * * @param xPath XPath query * @param parameters array of {@code String }parameters * @return {@code List} of id */ private List<String> getIdList(final String xPath, final String... parameters) { final List<String> idList = new ArrayList<String>(); final List<XmlDom> elements = getElements(xPath, parameters); for (final XmlDom element : elements) { final String id = element.getAttribute("Id"); idList.add(id); } return idList; }
/** * This method returns the list of certificates in the chain of the main signature. * * @param signatureId The identifier of the signature. * @return list of certificate's dss id for the given signature. */ public List<Integer> getSignatureCertificateChain(final String signatureId) { final ArrayList<Integer> certificateChain = new ArrayList<Integer>(); final List<XmlDom> certificateId = getElements("/DiagnosticData/Signature[@Id='%s']/CertificateChain/ChainCertificate", signatureId); for (final XmlDom xmlDom : certificateId) { final String id = xmlDom.getAttribute("Id"); certificateChain.add(Integer.valueOf(id)); } return certificateChain; }
/** * This method returns the list of identifier of the timestamps related to the given signature. * * @param signatureId The identifier of the signature. * @return The list of identifier of the timestamps */ public List<String> getTimestampIdList(final String signatureId) { final List<String> timestampIdList = new ArrayList<String>(); final List<XmlDom> timestamps = getElements("/DiagnosticData/Signature[@Id='%s']/Timestamps/Timestamp", signatureId); for (final XmlDom timestamp : timestamps) { final String timestampId = timestamp.getAttribute("Id"); timestampIdList.add(timestampId); } return timestampIdList; }
/** * This method returns the list of the signature id. The result is stored in the local variable. * * @return list of signature ids, is never null, can be empty */ public List<String> getSignatureIdList() { if (signatureIdList == null) { signatureIdList = new ArrayList<String>(); final List<XmlDom> signatures = getElements("/DiagnosticData/Signature"); for (final XmlDom signature : signatures) { final String signatureId = signature.getAttribute("Id"); signatureIdList.add(signatureId); } } return signatureIdList; }
/** * Converts the list of {@code XmlDom} to {@code Map} of {@code String}, {@code String}. The children of the node are not taken * into account. * * @param xmlDomList the list of {@code XmlDom} to convert * @param attributeName the name of the attribute to use as value * @return converted {@code Map} of {@code String}, {@code String} corresponding to the element content and the attribute value. */ public static Map<String, String> convertToStringMap(final List<XmlDom> xmlDomList, final String attributeName) { final Map<String, String> stringMap = new HashMap<String, String>(); for (final XmlDom xmlDom : xmlDomList) { final String key = xmlDom.getText(); final String value = xmlDom.getAttribute(attributeName); stringMap.put(key, value); } return stringMap; }
/** * This method returns the list of identifier of the timestamps related to the given signature. * * @param signatureId The identifier of the signature. * @param timestampType The {@code TimestampType} * @return The list of identifier of the timestamps */ public List<String> getTimestampIdList(final String signatureId, final TimestampType timestampType) { final List<String> timestampIdList = new ArrayList<String>(); final List<XmlDom> timestamps = getElements("/DiagnosticData/Signature[@Id='%s']/Timestamps/Timestamp[@Type='%s']", signatureId, timestampType.name()); for (final XmlDom timestamp : timestamps) { final String timestampId = timestamp.getAttribute("Id"); timestampIdList.add(timestampId); } return timestampIdList; }
final String dateString = xmlDom.getAttribute(attributeName); String format = xmlDom.getAttribute("Format"); if (DSSUtils.isBlank(format)) { format = "yyyy-MM-dd";
if (SIGNED_SIGNATURE.equals(nodeName)) { final String signatureId = xmlDom.getAttribute(ID); addSignaturePoe(signatureId, date); continue; final String category = xmlDom.getAttribute(CATEGORY); final String digestValue = xmlDom.getValue("./DigestValue/text()"); if (CERTIFICATE.toUpperCase().equals(category)) {
if (error != null) { final String algorithmExpirationDateString = error.getAttribute("AlgorithmExpirationDate"); if (DSSUtils.isNotBlank(algorithmExpirationDateString)) {