@Override protected boolean process() { boolean result = true; List<XmlSignatureScope> signatureScopes = signature.getSignatureScopes(); for (XmlSignatureScope sigScope : signatureScopes) { result &= (SignatureScopeType.FULL == sigScope.getScope()); } return result; }
private List<String> getCoveredFilesFromScope() { List<String> result = new ArrayList<String>(); List<XmlSignatureScope> signatureScopes = signature.getSignatureScopes(); for (XmlSignatureScope xmlSignatureScope : signatureScopes) { if (SignatureScopeType.FULL == xmlSignatureScope.getScope()) { result.add(xmlSignatureScope.getName()); } } return result; }
private SignatureScope parseSignatureScope(XmlSignatureScope dssSignatureScope) { SignatureScope signatureScope = new SignatureScope(); signatureScope.setContent(emptyWhenNull(dssSignatureScope.getValue())); signatureScope.setName(emptyWhenNull(dssSignatureScope.getName())); signatureScope.setScope(emptyWhenNull(dssSignatureScope.getScope())); if (CollectionUtils.isNotEmpty(validationDocument.getDatafiles())) { Optional<Datafile> dataFile = validationDocument.getDatafiles() .stream() .filter(datafile -> datafile.getFilename().equals(dssSignatureScope.getName())) .findFirst(); if (dataFile.isPresent()) { signatureScope.setHash(dataFile.get().getHash()); signatureScope.setHashAlgo(dataFile.get().getHashAlgo()); } } return signatureScope; }
private void addSignatureScope(final SignatureWrapper signature, final XmlSignature xmlSignature) { List<eu.europa.esig.dss.jaxb.diagnostic.XmlSignatureScope> signatureScopes = signature.getSignatureScopes(); if (Utils.isCollectionNotEmpty(signatureScopes)) { for (eu.europa.esig.dss.jaxb.diagnostic.XmlSignatureScope scopeType : signatureScopes) { XmlSignatureScope scope = new XmlSignatureScope(); scope.setName(scopeType.getName()); scope.setScope(scopeType.getScope().name()); scope.setValue(scopeType.getValue()); xmlSignature.getSignatureScope().add(scope); } } }