@Override public String getLastChainCertificateId() { XmlChainItem item = getLastChainCertificate(); return item == null ? Utils.EMPTY_STRING : item.getId(); }
@Override public String getLastChainCertificateSource() { XmlChainItem item = getLastChainCertificate(); return item == null ? Utils.EMPTY_STRING : item.getSource(); }
/** * Create an instance of {@link XmlChainItem } * */ public XmlChainItem createXmlChainItem() { return new XmlChainItem(); }
@Override protected void addAdditionalInfo() { super.addAdditionalInfo(); if (token.getCertificateChain() != null) { XmlCertificateChain certificateChain = new XmlCertificateChain(); for (eu.europa.esig.dss.jaxb.diagnostic.XmlChainItem diagnosticChainItem : token.getCertificateChain()) { XmlChainItem chainItem = new XmlChainItem(); chainItem.setId(diagnosticChainItem.getId()); chainItem.setSource(diagnosticChainItem.getSource()); certificateChain.getChainItem().add(chainItem); } result.setCertificateChain(certificateChain); } }
@Override public String getFirstChainCertificateId() { XmlChainItem item = getFirstChainCertificate(); return item == null ? Utils.EMPTY_STRING : item.getId(); }
@Override public List<String> getCertificateChainIds() { List<String> result = new ArrayList<String>(); List<XmlChainItem> certificateChain = getCertificateChain(); if (Utils.isCollectionNotEmpty(certificateChain)) { for (XmlChainItem xmlChainCertificate : certificateChain) { result.add(xmlChainCertificate.getId()); } } return result; }
CertificateWrapper certificate = diagnosticData.getUsedCertificateById(certChainItem.getId()); if (certificate.isTrusted()) { if (Utils.areStringsEqual(signingCertificateId, certChainItem.getId())) { subContext = SubContext.SIGNING_CERT; certificateChain = token.getCertificateChain(); for (XmlChainItem certChainItem : certificateChain) { CertificateWrapper certificate = diagnosticData.getUsedCertificateById(certChainItem.getId()); if (certificate.isTrusted()) { if (Utils.areStringsEqual(signingCertificateId, certChainItem.getId())) { subContext = SubContext.SIGNING_CERT;
@Override protected void initChain() { ChainItem<XmlXCV> item = firstItem = prospectiveCertificateChain(); if (currentCertificate.isTrusted() || currentCertificate.isTrustedChain()) { item = item.setNextItem(trustedServiceWithExpectedTypeIdentifier()); item = item.setNextItem(trustedServiceWithExpectedStatus()); SubX509CertificateValidation certificateValidation = new SubX509CertificateValidation(currentCertificate, validationDate, context, SubContext.SIGNING_CERT, validationPolicy); XmlSubXCV subXCV = certificateValidation.execute(); result.getSubXCV().add(subXCV); boolean trustAnchorReached = currentCertificate.isTrusted(); // Check CA_CERTIFICATEs List<XmlChainItem> certificateChainList = currentCertificate.getCertificateChain(); if (Utils.isCollectionNotEmpty(certificateChainList)) { for (XmlChainItem chainCertificate : certificateChainList) { if (!trustAnchorReached) { CertificateWrapper certificate = diagnosticData.getUsedCertificateByIdNullSafe(chainCertificate.getId()); certificateValidation = new SubX509CertificateValidation(certificate, validationDate, context, SubContext.CA_CERTIFICATE, validationPolicy); subXCV = certificateValidation.execute(); result.getSubXCV().add(subXCV); trustAnchorReached = certificate.isTrusted(); } } } for (XmlSubXCV subXCVresult : result.getSubXCV()) { item = item.setNextItem(checkSubXCVResult(subXCVresult)); } } }