/** * This method returns {@code XmlDom} representation of the current {@code XmlNode}. * * @return the {@code XmlDom} representation of the current {@code XmlNode}. */ public XmlDom toXmlDom() { final Document document = toDocument(); final XmlDom xmlDom = new XmlDom(document); return xmlDom; }
/** * This method returns the status of the associated TSP service. * * @param cert The certificate * @return */ public static String getStatus(final XmlDom cert) { final String status = cert.getValue("./TrustedServiceProvider/Status/text()"); return status; }
private void addBasicInfo(final XmlNode signatureNode, final List<XmlDom> basicValidationErrorList) { for (final XmlDom error : basicValidationErrorList) { signatureNode.addChild(error); } }
private void addSignatureFormat(final XmlDom diagnosticSignature, final XmlNode signatureNode) { signatureNode.setAttribute(NodeName.SIGNATURE_FORMAT, diagnosticSignature.getValue("./SignatureFormat/text()")); }
/** * @param id the {@code String} SD-DSS certificate unique identifier * @return Returns the {@code XmlDom} representing the corresponding certificate or null. */ public XmlDom getCertificate(final String id) { return certPool == null ? certPool : certPool.getElement("./Certificate[@Id='%s']", id); }
private boolean getBoolValue(final XmlDom xmlDom, final String xPath) { return xmlDom == null ? false : xmlDom.getBoolValue(xPath); }
/** * This method returns the end date of the associated TSP service. * * @param cert The certificate * @return */ public static Date getEndDate(final XmlDom cert) { final Date endDate = cert.getTimeValue("./TrustedServiceProvider/EndDate/text()"); return endDate; }
/** * This method returns the signing certificate. * * @param signature * @return */ public static int getSigningCertificateId(final XmlDom signature) { final int signingCertId = signature.getIntValue("./SigningCertificate/@Id"); return signingCertId; }
public void addChild(final XmlDom child) { final Element element = child.rootElement; recursiveCopy(this, element); }
private void addCounterSignature(XmlDom diagnosticSignature, XmlNode signatureNode, String type) { if (AttributeValue.COUNTERSIGNATURE.equals(type)) { signatureNode.setAttribute(AttributeName.TYPE, AttributeValue.COUNTERSIGNATURE); final String parentId = diagnosticSignature.getValue("./ParentId/text()"); signatureNode.setAttribute(AttributeName.PARENT_ID, parentId); } }
/** * This method returns the TSPName. * * @param trustedAnchor The trust anchor belonging to the service. * @return */ public static String getTSPName(final XmlDom trustedAnchor) { final String tspName = trustedAnchor.getValue("./TrustedServiceProvider/TSPName/text()"); return tspName; }
private void addSignatureScope(final XmlNode signatureNode, final XmlDom signatureScopes) { if (signatureScopes != null) { signatureNode.addChild(signatureScopes); } }
public boolean exists(final String xPath, final Object... params) { XmlDom element = getElement(xPath, params); return element != null; }
/** * This method returns the start date of the associated TSP service. * * @param cert The certificate * @return */ public static Date getStartDate(final XmlDom cert) { final Date startDate = cert.getTimeValue("./TrustedServiceProvider/StartDate/text()"); return startDate; }
/** * This method returns the certificate id. This id is extracted either from the ChainCertificate, or Certificate. * * @param xmlDomObject * @return */ public static int getCertificateId(final XmlDom xmlDomObject) { final int certificateId = xmlDomObject.getIntValue("./@Id"); return certificateId; }
/** * This method returns the ServiceTypeIdentifier related to the certificate . * * @param cert The certificate. * @return */ public static String getServiceTypeIdentifier(final XmlDom cert) { final String serviceTypeIdentifier = cert.getValue("./TrustedServiceProvider/TSPServiceType/text()"); return serviceTypeIdentifier; }
public void setParent(final XmlNode parentNode) { this.parentNode = parentNode; if (parentNode != null) { parentNode.addChild(this); } }
/** * This method returns the ServiceName related to the certificate. * * @param cert The certificate * @return */ public static String getServiceName(final XmlDom cert) { final String serviceName = cert.getValue("./TrustedServiceProvider/TSPServiceName/text()"); return serviceName; }
public void addChildren(final List<XmlDom> xmlDomList) { for (final XmlDom xmlDom : xmlDomList) { addChild(xmlDom); } }