- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Charset c =
String charsetName;Charset.forName(charsetName)
Charset.defaultCharset()
ContentType contentType;contentType.getCharset()
- Smart code suggestions by Codota
}
/** * This method extracts all timestamps from the {@code XmlDom} signature representation and adds them to the timestamp {@code List} * * @param signature {@code XmlDom} representation of the signature * @param timestampType * @param timestamps the {@code List} of the all extracted timestamps */ private void extractTimestamp(final XmlDom signature, final TimestampType timestampType, final List<XmlDom> timestamps) { final String xPath = "./Timestamps/Timestamp[@Type='%s']"; final List<XmlDom> extractedTimestamps = signature.getElements(xPath, timestampType); timestamps.addAll(extractedTimestamps); }
public void copyWarnings(final XmlDom conclusionXmlDom) { final List<XmlDom> warnings = conclusionXmlDom.getElements("./Warning"); addWarnings(warnings); }
/** * This function returns the list of qualifiers for the given certificate. * * @param certificate The certificate * @return the {@code List} of qualifiers or an empty list if the certificate is null. */ public static List<String> getQualifiers(final XmlDom certificate) { if (certificate == null) { return new ArrayList<String>(); } final List<XmlDom> qualifiersDomList = certificate.getElements("./TrustedServiceProvider/Qualifiers/Qualifier"); final List<String> qualifiers = XmlDom.convertToStringList(qualifiersDomList); return qualifiers; }
public void copyConclusion(final XmlDom conclusionXmlDom) { final String indication = conclusionXmlDom.getValue("./Indication/text()"); if (!indication.isEmpty()) { this.indication = indication; } final String subIndication = conclusionXmlDom.getValue("./SubIndication/text()"); if (!subIndication.isEmpty()) { this.subIndication = subIndication; } final List<XmlDom> errors = conclusionXmlDom.getElements("./Error"); addErrors(errors); final List<XmlDom> warnings = conclusionXmlDom.getElements("./Warning"); addWarnings(warnings); final List<XmlDom> info = conclusionXmlDom.getElements("./Info"); addInfo(info); }
final List<XmlDom> tspList = certificateXmlDom.getElements("./TrustedServiceProvider"); boolean acceptableStatus = false; String status = DSSUtils.EMPTY;
final List<XmlDom> nodes = timestamp.getElements("./SignedObjects/*"); for (final XmlDom xmlDom : nodes) {
final List<XmlDom> tspList = certificateXmlDom.getElements("./TrustedServiceProvider"); boolean found = false; for (final XmlDom trustedServiceProviderXmlDom : tspList) {
final String ltvIndication = ltvConclusion.getValue("./Indication/text()"); final String ltvSubIndication = ltvConclusion.getValue("./SubIndication/text()"); final List<XmlDom> ltvInfoList = ltvConclusion.getElements("./Info"); infoList.addAll(ltvInfoList); final List<XmlDom> basicValidationInfoList = basicValidationConclusion.getElements("./Info"); final List<XmlDom> basicValidationWarningList = basicValidationConclusion.getElements("./Warning"); final List<XmlDom> basicValidationErrorList = basicValidationConclusion.getElements("./Error"); final List<XmlDom> errorMessages = diagnosticSignature.getElements("./ErrorMessage"); for (XmlDom errorDom : errorMessages) {
final List<XmlDom> tspList = certificateXmlDom.getElements("./TrustedServiceProvider"); boolean found = false; for (final XmlDom trustedServiceProviderXmlDom : tspList) {
final List<XmlDom> timestamps = signatureXmlDom.getElements("./Timestamps/Timestamp[@Type='%s']", TimestampType.SIGNATURE_TIMESTAMP); timestamps.addAll(signatureXmlDom.getElements("./Timestamps/Timestamp[@Type='%s']", TimestampType.CONTENT_TIMESTAMP)); timestamps.addAll(signatureXmlDom.getElements("./Timestamps/Timestamp[@Type='%s']", TimestampType.ALL_DATA_OBJECTS_TIMESTAMP)); timestamps.addAll(signatureXmlDom.getElements("./Timestamps/Timestamp[@Type='%s']", TimestampType.INDIVIDUAL_DATA_OBJECTS_TIMESTAMP));
/** * Check of unsigned qualifying property: claimed roles * * @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 checkClaimedRoleConstraint(final Conclusion conclusion) { final Constraint constraint = constraintData.getClaimedRoleConstraint(); if (constraint == null) { return true; } constraint.create(subProcessNode, BBB_SAV_ICRM); final List<XmlDom> claimedRolesXmlDom = signatureContext.getElements("./ClaimedRoles/ClaimedRole"); final List<String> claimedRoles = XmlDom.convertToStringList(claimedRolesXmlDom); // TODO (Bob) to be implemented fro each claimed role. Attendance must be taken into account. final String attendance = constraintData.getCertifiedRolesAttendance(); String claimedRole = null; for (String claimedRole_ : claimedRoles) { claimedRole = claimedRole_; break; } if ("ANY".equals(attendance)) { constraint.setExpectedValue("*"); } constraint.setValue(claimedRole); constraint.setIndications(INVALID, SIG_CONSTRAINTS_FAILURE, BBB_SAV_ICRM_ANS); constraint.setConclusionReceiver(conclusion); boolean check = constraint.checkInList(); return check; }
/** * This method checks if the signing certificate has an appropriate key usage. * * @param conclusion the conclusion to use to add the result of the check. * @param certificateId * @param certificateXmlDom * @return */ private boolean checkKeyUsageConstraint(Conclusion conclusion, String certificateId, XmlDom certificateXmlDom) { final Constraint constraint = constraintData.getSigningCertificateKeyUsageConstraint(contextName); if (constraint == null) { return true; } constraint.create(validationDataXmlNode, BBB_XCV_ISCGKU); final List<XmlDom> keyUsageBits = certificateXmlDom.getElements("./KeyUsageBits/KeyUsage"); final List<String> stringList = XmlDom.convertToStringList(keyUsageBits); constraint.setValue(stringList); constraint.setIndications(INVALID, SIG_CONSTRAINTS_FAILURE, BBB_XCV_ISCGKU_ANS); constraint.setAttribute(CERTIFICATE_ID, certificateId); constraint.setConclusionReceiver(conclusion); return constraint.checkInList(); }
final List<XmlDom> signatures = diagnosticData.getElements("/DiagnosticData/Signature");
if (signProductionPlaceXmlDom != null) { final List<XmlDom> elements = signProductionPlaceXmlDom.getElements("./*"); for (final XmlDom element : elements) {
final List<XmlDom> signatures = diagnosticData.getElements("/DiagnosticData/Signature"); for (final XmlDom signature : signatures) {
final List<XmlDom> certificates = params.getCertPool().getElements("./Certificate"); final List<XmlDom> adestInfo = adestSignatureConclusion.getElements("./Info"); constraintNode.addChildren(adestInfo); conclusionNode.addChildren(adestInfo); final List<XmlDom> archiveTimestamps = signature.getElements("./Timestamps/Timestamp[@Type='%s']", TimestampType.ARCHIVE_TIMESTAMP); if (archiveTimestamps.size() > 0) { final List<XmlDom> refsOnlyTimestamps = signature.getElements("./Timestamps/Timestamp[@Type='%s']", TimestampType.VALIDATION_DATA_REFSONLY_TIMESTAMP); if (refsOnlyTimestamps.size() > 0) { final List<XmlDom> sigAndRefsTimestamps = signature.getElements("./Timestamps/Timestamp[@Type='%s']", TimestampType.VALIDATION_DATA_TIMESTAMP); if (sigAndRefsTimestamps.size() > 0) { final List<XmlDom> timestamps = signature.getElements("./Timestamps/Timestamp[@Type='%s']", TimestampType.SIGNATURE_TIMESTAMP); if (timestamps.size() > 0) {
final List<XmlDom> signatures = basicBuildingBlocksReport.getElements("./Signature"); for (final XmlDom signature : signatures) {
final List<XmlDom> timestamps = signatureXmlDom.getElements("./Timestamps/Timestamp");
LOG.debug(this.getClass().getSimpleName() + ": start."); final List<XmlDom> signatures = diagnosticData.getElements("/DiagnosticData/Signature");
final List<XmlDom> signatures = diagnosticData.getElements("/DiagnosticData/Signature");