Skip to content

Commit

Permalink
Merge pull request #88 from agelostsal/devel
Browse files Browse the repository at this point in the history
ET-130 AIADefaultSource should use the CommonsDataLoader
  • Loading branch information
agelostsal authored Nov 23, 2022
2 parents 1768ca0 + 62b1dfc commit 294c799
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion eseal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
<version>1.18.24</version>
<scope>provided</scope>
</dependency>
<!-- Hibernate validator - Bean validation API Implementation -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import eu.europa.esig.dss.service.http.commons.CommonsDataLoader;
import eu.europa.esig.dss.service.http.commons.OCSPDataLoader;
import eu.europa.esig.dss.service.ocsp.OnlineOCSPSource;
import eu.europa.esig.dss.spi.x509.aia.DefaultAIASource;
import eu.europa.esig.dss.utils.Utils;
import eu.europa.esig.dss.validation.CRLFirstRevocationDataLoadingStrategy;
import eu.europa.esig.dss.validation.CommonCertificateVerifier;
Expand Down Expand Up @@ -108,6 +109,9 @@ public String signDocument(SignDocumentDto signDocumentDto) {
onlineOCSPSource.setDataLoader(ocspDataLoader);
commonCertificateVerifier.setOcspSource(onlineOCSPSource);

// AIA Source
commonCertificateVerifier.setAIASource(new DefaultAIASource(new CommonsDataLoader()));

commonCertificateVerifier.setAlertOnMissingRevocationData(new ExceptionOnStatusAlert());
commonCertificateVerifier.setAlertOnUncoveredPOE(new LogOnStatusAlert());
commonCertificateVerifier.setAlertOnRevokedCertificate(new ExceptionOnStatusAlert());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
import eu.europa.esig.dss.pades.PAdESTimestampParameters;
import eu.europa.esig.dss.pades.signature.PAdESService;
import eu.europa.esig.dss.service.crl.OnlineCRLSource;
import eu.europa.esig.dss.service.http.commons.CommonsDataLoader;
import eu.europa.esig.dss.service.http.commons.TimestampDataLoader;
import eu.europa.esig.dss.service.ocsp.OnlineOCSPSource;
import eu.europa.esig.dss.spi.x509.aia.DefaultAIASource;
import eu.europa.esig.dss.utils.Utils;
import eu.europa.esig.dss.validation.CommonCertificateVerifier;
import gr.grnet.eseal.enums.TSASourceEnum;
Expand Down Expand Up @@ -48,6 +50,7 @@ public String timestampDocument(String document, TSASourceEnum tsaSourceEnum) {
certificateVerifier.setDataLoader(new TimestampDataLoader());
certificateVerifier.setCrlSource(new OnlineCRLSource());
certificateVerifier.setOcspSource(new OnlineOCSPSource());
certificateVerifier.setAIASource(new DefaultAIASource(new CommonsDataLoader()));

// Configure a PAdES service for PDF timestamping
PAdESService service = new PAdESService(certificateVerifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import eu.europa.esig.dss.spi.client.http.IgnoreDataLoader;
import eu.europa.esig.dss.spi.tsl.TrustedListsCertificateSource;
import eu.europa.esig.dss.spi.x509.KeyStoreCertificateSource;
import eu.europa.esig.dss.spi.x509.aia.DefaultAIASource;
import eu.europa.esig.dss.tsl.alerts.LOTLAlert;
import eu.europa.esig.dss.tsl.alerts.TLAlert;
import eu.europa.esig.dss.tsl.alerts.detections.LOTLLocationChangeDetection;
Expand Down Expand Up @@ -107,6 +108,7 @@ private CertificateVerifier initializeCertificateVerifier() {
certificateVerifier.setDataLoader(new CommonsDataLoader());
certificateVerifier.setCrlSource(new OnlineCRLSource());
certificateVerifier.setOcspSource(new OnlineOCSPSource());
certificateVerifier.setAIASource(new DefaultAIASource(new CommonsDataLoader()));

return certificateVerifier;
}
Expand Down

0 comments on commit 294c799

Please sign in to comment.