Codota Logo
XmlDom.getBoolValue
Code IndexAdd Codota to your IDE (free)

How to use
getBoolValue
method
in
eu.europa.ec.markt.dss.validation102853.xml.XmlDom

Best Java code snippets using eu.europa.ec.markt.dss.validation102853.xml.XmlDom.getBoolValue (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: arhs/sd-dss

private boolean getBoolValue(final XmlDom xmlDom, final String xPath) {
  return xmlDom == null ? false : xmlDom.getBoolValue(xPath);
}
origin: arhs/sd-dss

/**
 * This method indicates if the certificate signature is valid and the revocation status is valid.
 *
 * @param dssCertificateId DSS certificate identifier to be checked
 * @return certificate validity
 */
public boolean isValidCertificate(final int dssCertificateId) {
  final XmlDom certificate = getElement("/DiagnosticData/UsedCertificates/Certificate[@Id='%s']", dssCertificateId);
  final boolean signatureValid = certificate.getBoolValue("./BasicSignature/SignatureValid/text()");
  final boolean revocationValid = certificate.getBoolValue("./Revocation/Status/text()");
  final boolean trusted = certificate.getBoolValue("./Trusted/text()");
  final boolean validity = signatureValid && (trusted ? true : revocationValid);
  return validity;
}
origin: arhs/sd-dss

/**
 * Indicates if the -T level is technically valid. It means that the signature and the digest are valid.
 *
 * @param signatureId The identifier of the signature.
 * @return true if the signature and digest are valid
 */
public boolean isTLevelTechnicallyValid(final String signatureId) {
  final List<XmlDom> timestamps = getElements("/DiagnosticData/Signature[@Id='%s']/Timestamps/Timestamp[@Type='%s']", signatureId, TimestampType.SIGNATURE_TIMESTAMP.name());
  for (final XmlDom timestamp : timestamps) {
    final boolean signatureValid = timestamp.getBoolValue("./BasicSignature/SignatureValid/text()");
    final boolean messageImprintIntact = timestamp.getBoolValue("./MessageImprintDataIntact/text()");
    if (signatureValid && messageImprintIntact) {
      return true;
    }
  }
  return false;
}
origin: arhs/sd-dss

final boolean isQCC = certificate.getBoolValue("./QCStatement/QCC/text()");
final boolean isQCP = certificate.getBoolValue("./QCStatement/QCP/text()");
final boolean isQCPPlus = certificate.getBoolValue("./QCStatement/QCPPlus/text()");
origin: arhs/sd-dss

/**
 * Indicates if the -A (-LTA) level is technically valid. It means that the signature of the archive timestamps are valid and their imprint is valid too.
 *
 * @param signatureId The identifier of the signature.
 * @return true if the signature and digest are valid
 */
public boolean isALevelTechnicallyValid(final String signatureId) {
  final List<XmlDom> timestamps = getElements("/DiagnosticData/Signature[@Id='%s']/Timestamps/Timestamp[@Type='%s']", signatureId, TimestampType.ARCHIVE_TIMESTAMP.name());
  for (final XmlDom timestamp : timestamps) {
    final boolean signatureValid = timestamp.getBoolValue("./BasicSignature/SignatureValid/text()");
    final boolean messageImprintIntact = timestamp.getBoolValue("./MessageImprintDataIntact/text()");
    if (signatureValid && messageImprintIntact) {
      return true;
    }
  }
  return false;
}
origin: arhs/sd-dss

final boolean qcSSCD = certificate.getBoolValue("./QCStatement/QCSSCD/text()");
final boolean qcpPlus = certificate.getBoolValue("./QCStatement/QCPPlus/text()");
origin: arhs/sd-dss

protected boolean isTrustedProspectiveCertificateChain(final ProcessParameters params) {
  final String lastChainCertId = contextElement.getValue("./CertificateChain/ChainCertificate[last()]/@Id");
  final XmlDom lastChainCertificate = params.getCertificate(lastChainCertId);
  boolean lastChainCertificateTrusted = false;
  if (lastChainCertificate != null) {
    lastChainCertificateTrusted = lastChainCertificate.getBoolValue("./Trusted/text()");
  }
  return lastChainCertificateTrusted;
}
origin: arhs/sd-dss

/**
 * Indicates if the -X level is technically valid. It means that the signature and the digest are valid.
 *
 * @param signatureId The identifier of the signature.
 * @return true if the signature and digest are valid
 */
public boolean isXLevelTechnicallyValid(final String signatureId) {
  final List<XmlDom> vdroTimestamps = getElements("/DiagnosticData/Signature[@Id='%s']/Timestamps/Timestamp[@Type='%s']", signatureId,
     TimestampType.VALIDATION_DATA_REFSONLY_TIMESTAMP.name());
  final List<XmlDom> vdTimestamps = getElements("/DiagnosticData/Signature[@Id='%s']/Timestamps/Timestamp[@Type='%s']", signatureId,
     TimestampType.VALIDATION_DATA_TIMESTAMP.name());
  final List<XmlDom> timestamps = new ArrayList<XmlDom>(vdroTimestamps);
  timestamps.addAll(vdroTimestamps);
  for (final XmlDom timestamp : timestamps) {
    final boolean signatureValid = timestamp.getBoolValue("./BasicSignature/SignatureValid/text()");
    final boolean messageImprintIntact = timestamp.getBoolValue("./MessageImprintDataIntact/text()");
    if (signatureValid && messageImprintIntact) {
      return true;
    }
  }
  return false;
}
origin: arhs/sd-dss

/**
 * This method returns the type of the qualification of the signature (signing certificate).
 *
 * @param signCert
 * @return
 */
private SignatureType getSignatureType(final XmlDom signCert) {
  final CertificateQualification certQualification = new CertificateQualification();
  certQualification.setQcp(signCert.getBoolValue("./QCStatement/QCP/text()"));
  certQualification.setQcpp(signCert.getBoolValue("./QCStatement/QCPPlus/text()"));
  certQualification.setQcc(signCert.getBoolValue("./QCStatement/QCC/text()"));
  certQualification.setQcsscd(signCert.getBoolValue("./QCStatement/QCSSCD/text()"));
  final TLQualification trustedListQualification = new TLQualification();
  final String caqc = InvolvedServiceInfo.getServiceTypeIdentifier(signCert);
  final List<String> qualifiers = InvolvedServiceInfo.getQualifiers(signCert);
  trustedListQualification.setCaqc(TSLConstant.CA_QC.equals(caqc));
  trustedListQualification.setQcCNoSSCD(InvolvedServiceInfo.isQC_NO_SSCD(qualifiers));
  trustedListQualification.setQcForLegalPerson(InvolvedServiceInfo.isQC_FOR_LEGAL_PERSON(qualifiers));
  trustedListQualification.setQcSSCDAsInCert(InvolvedServiceInfo.isQCSSCD_STATUS_AS_IN_CERT(qualifiers));
  trustedListQualification.setQcWithSSCD(qualifiers.contains(TSLConstant.QC_WITH_SSCD) || qualifiers.contains(TSLConstant.QC_WITH_SSCD_119612));
  final SignatureType signatureType = SignatureQualification.getSignatureType(certQualification, trustedListQualification);
  return signatureType;
}
origin: arhs/sd-dss

private boolean checkSigningCertificateAttributePresentConstraint(final Conclusion conclusion) {
  final Constraint constraint = params.getCurrentValidationPolicy().getSigningCertificateAttributePresentConstraint(contextName);
  if (constraint == null) {
    return true;
  }
  constraint.create(validationDataXmlNode, BBB_ICS_ISASCP);
  final boolean digestValueMatch = contextElement.getBoolValue("./SigningCertificate/AttributePresent/text()");
  constraint.setValue(digestValueMatch);
  constraint.setIndications(INVALID, FORMAT_FAILURE, BBB_ICS_ISASCP_ANS);
  constraint.setConclusionReceiver(conclusion);
  return constraint.check();
}
origin: arhs/sd-dss

/**
 * Check of: is the timestamp message imprint data intact
 *
 * @param conclusion the conclusion to use to add the result of the check.
 * @param timestamp
 * @return false if the check failed and the process should stop, true otherwise.
 */
private boolean checkMessageImprintDataIntactConstraint(final Conclusion conclusion, final XmlDom timestamp) {
  final Constraint constraint = constraintData.getMessageImprintDataIntactConstraint();
  if (constraint == null) {
    return true;
  }
  constraint.create(timestampXmlNode, ADEST_IMIVC);
  final boolean messageImprintDataIntact = timestamp.getBoolValue(XP_MESSAGE_IMPRINT_DATA_INTACT);
  constraint.setValue(messageImprintDataIntact);
  constraint.setIndications(ADEST_IMIVC_ANS);
  constraint.setConclusionReceiver(conclusion);
  return constraint.check();
}
origin: arhs/sd-dss

/**
 * 2) Check the integrity of the signed data objects. In case of failure, abort the signature validation process
 * with INVALID/HASH_FAILURE.
 *
 * @param conclusion the conclusion to use to add the result of the check.
 * @return false if the check failed and the process should stop, true otherwise.
 */
private boolean checkReferenceDataIntactConstraint(Conclusion conclusion) {
  final Constraint constraint = constraintData.getReferenceDataIntactConstraint();
  if (constraint == null) {
    return true;
  }
  constraint.create(subProcessNode, BBB_CV_IRDOI);
  final boolean referenceDataIntact = contextElement.getBoolValue(XP_REFERENCE_DATA_INTACT);
  constraint.setValue(referenceDataIntact);
  constraint.setIndications(INVALID, HASH_FAILURE, BBB_CV_IRDOI_ANS);
  constraint.setConclusionReceiver(conclusion);
  return constraint.check();
}
origin: arhs/sd-dss

/**
 * 1) Obtain the signed data objects(s) if not provided in the inputs (e.g. by dereferencing an URI present in the
 * signature). If the signed data object (s) cannot be obtained, abort with the indication
 * INDETERMINATE/SIGNED_DATA_NOT_FOUND.
 *
 * @param conclusion the conclusion to use to add the result of the check.
 * @return false if the check failed and the process should stop, true otherwise.
 */
private boolean checkReferenceDataExistenceConstraint(Conclusion conclusion) {
  final Constraint constraint = constraintData.getReferenceDataExistenceConstraint();
  if (constraint == null) {
    return true;
  }
  constraint.create(subProcessNode, BBB_CV_IRDOF);
  final boolean referenceDataFound = contextElement.getBoolValue(XP_REFERENCE_DATA_FOUND);
  constraint.setValue(referenceDataFound);
  constraint.setIndications(INDETERMINATE, SIGNED_DATA_NOT_FOUND, BBB_CV_IRDOF_ANS);
  constraint.setConclusionReceiver(conclusion);
  return constraint.check();
}
origin: arhs/sd-dss

  /**
   * 3) Verify the cryptographic signature using the public key extracted from the signer's certificate in the
   * chain, the signature value and the signature algorithm extracted from the signature. If this cryptographic
   * verification outputs a success indication, terminate with VALID. Otherwise, terminate with
   * INVALID/SIG_CRYPTO_FAILURE.
   *
   * @param conclusion the conclusion to use to add the result of the check.
   * @return false if the check failed and the process should stop, true otherwise.
   */
  private boolean checkSignatureIntactConstraint(Conclusion conclusion) {

    final Constraint constraint = constraintData.getSignatureIntactConstraint();
    if (constraint == null) {
      return true;
    }
    constraint.create(subProcessNode, BBB_CV_ISI);
    final boolean signatureIntact = contextElement.getBoolValue(XP_SIGNATURE_INTACT);
    constraint.setValue(signatureIntact);
    constraint.setIndications(INVALID, SIG_CRYPTO_FAILURE, BBB_CV_ISI_ANS);
    constraint.setConclusionReceiver(conclusion);

    return constraint.check();
  }
}
origin: arhs/sd-dss

/**
 * Check of: is the timestamp message imprint data found
 * <p/>
 * 4) Signature time-stamp validation: Perform the following steps:
 * <p/>
 * a) Message imprint verification: For each time-stamp token in the set of signature time-stamp tokens, do the
 * message imprint verification as specified in clauses 8.4.1 or 8.4.2 depending on the type of the signature.
 * If the verification fails, remove the token from the set.
 *
 * @param conclusion the conclusion to use to add the result of the check.
 * @param timestamp
 * @return false if the check failed and the process should stop, true otherwise.
 */
private boolean checkMessageImprintDataFoundConstraint(final Conclusion conclusion, final XmlDom timestamp) {
  final Constraint constraint = constraintData.getMessageImprintDataFoundConstraint();
  if (constraint == null) {
    return true;
  }
  constraint.create(timestampXmlNode, ADEST_IMIDF);
  final boolean messageImprintDataIntact = timestamp.getBoolValue(XP_MESSAGE_IMPRINT_DATA_FOUND);
  constraint.setValue(messageImprintDataIntact);
  constraint.setIndications(ADEST_IMIDF_ANS);
  constraint.setConclusionReceiver(conclusion);
  return constraint.check();
}
origin: arhs/sd-dss

/**
 * This method checks if the digest value of the signing certificate is within the signature
 *
 * @param conclusion the conclusion to use to add the result of the check.
 * @return false if the check failed and the process should stop, true otherwise.
 */
private boolean checkDigestValuePresentConstraint(final Conclusion conclusion) {
  final Constraint constraint = params.getCurrentValidationPolicy().getSigningCertificateDigestValuePresentConstraint(contextName);
  if (constraint == null) {
    return true;
  }
  constraint.create(validationDataXmlNode, BBB_ICS_ISACDP);
  final boolean digestValueMatch = contextElement.getBoolValue("./SigningCertificate/DigestValuePresent/text()");
  constraint.setValue(digestValueMatch);
  constraint.setIndications(INVALID, FORMAT_FAILURE, BBB_ICS_ISACDP_ANS);
  constraint.setConclusionReceiver(conclusion);
  return constraint.check();
}
origin: arhs/sd-dss

/**
 * This method checks the signature of the given certificate.
 *
 * @param conclusion        the conclusion to use to add the result of the check.
 * @param certificateId
 * @param certificateXmlDom
 * @param subContext
 * @return false if the check failed and the process should stop, true otherwise.
 */
private boolean checkCertificateSignatureConstraint(final Conclusion conclusion, final String certificateId, final XmlDom certificateXmlDom, final String subContext) {
  final Constraint constraint = constraintData.getCertificateSignatureConstraint(contextName, subContext);
  if (constraint == null) {
    return true;
  }
  constraint.create(validationDataXmlNode, BBB_XCV_ICSI);
  constraint.setValue(certificateXmlDom.getBoolValue(XP_SIGNATURE_VALID));
  constraint.setIndications(INDETERMINATE, NO_CERTIFICATE_CHAIN_FOUND, BBB_XCV_ICSI_ANS);
  constraint.setAttribute(CERTIFICATE_ID, certificateId);
  constraint.setConclusionReceiver(conclusion);
  return constraint.check();
}
origin: arhs/sd-dss

final boolean issuerSerialMatch = contextElement.getBoolValue("./SigningCertificate/IssuerSerialMatch/text()");
constraint.setValue(issuerSerialMatch);
constraint.setIndications(INDETERMINATE, NO_SIGNER_CERTIFICATE_FOUND, BBB_ICS_AIDNASNE_ANS);
origin: arhs/sd-dss

/**
 * Check of structural validation (only for XAdES signature: XSD schema validation)
 *
 * @param conclusion the conclusion to use to add the result of the check.
 * @return false if the check failed and the process should stop, true otherwise.
 */
private boolean checkStructuralValidationConstraint(final Conclusion conclusion) {
  final Constraint constraint = constraintData.getStructuralValidationConstraint();
  if (constraint == null) {
    return true;
  }
  constraint.create(subProcessNode, BBB_SAV_ISSV);
  final boolean structureValid = signatureContext.getBoolValue("./StructuralValidation/Valid/text()");
  constraint.setValue(structureValid);
  final String message = signatureContext.getValue("./StructuralValidation/Message/text()");
  if (DSSUtils.isNotBlank(message)) {
    constraint.setAttribute("Log", message);
  }
  constraint.setIndications(INVALID, SIG_CONSTRAINTS_FAILURE, BBB_SAV_ISSV_ANS);
  constraint.setConclusionReceiver(conclusion);
  return constraint.check();
}
origin: arhs/sd-dss

final boolean digestValueMatch = contextElement.getBoolValue("./SigningCertificate/DigestValueMatch/text()");
constraint.setValue(digestValueMatch);
constraint.setIndications(INVALID, FORMAT_FAILURE, BBB_ICS_ICDVV_ANS);
eu.europa.ec.markt.dss.validation102853.xmlXmlDomgetBoolValue

Popular methods of XmlDom

  • getText
  • <init>
  • exists
  • getAttribute
    Retrieves an attribute value by name.
  • getElement
  • getElements
    The list of elements corresponding the given XPath query and parameters.
  • getRootElement
  • getValue
  • addNamespacePrefix
  • convertToStringDateMap
    Converts the list of XmlDom to Map of String, Date. The children of the node are not taken into acco
  • convertToStringList
    Converts the list of XmlDom to List of String. The children of the node are not taken into account.
  • convertToStringMap
    Converts the list of XmlDom to Map of String, String. The children of the node are not taken into ac
  • convertToStringList,
  • convertToStringMap,
  • createXPathExpression,
  • format,
  • getAttributes,
  • getCountValue,
  • getIntValue,
  • getName,
  • getNodeList

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now