Skip to content

Commit

Permalink
fix: add security provider in btp impl (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
jurosens authored Jun 7, 2021
1 parent d25a790 commit 15313c6
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@
import eu.europa.ec.dgc.gateway.connector.dto.TrustListItemDto;
import eu.europa.ec.dgc.gateway.connector.model.TrustListItem;
import java.io.IOException;
import java.security.Security;
import java.security.cert.CertificateException;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;
Expand All @@ -49,6 +51,7 @@
import org.apache.http.util.EntityUtils;
import org.bouncycastle.cert.CertException;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.operator.ContentVerifierProvider;
import org.bouncycastle.operator.OperatorCreationException;
import org.bouncycastle.operator.RuntimeOperatorException;
Expand All @@ -75,6 +78,11 @@ public class SignerCertificateDownloadBtpServiceImpl implements SignerCertificat

private final SignerInformationService signerInformationService;

@PostConstruct
private void init() {
Security.addProvider(new BouncyCastleProvider());
}

@Override
@Scheduled(fixedDelayString = "${dgc.certificatesDownloader.timeInterval}")
@SchedulerLock(name = "SignerCertificateDownloadService_downloadCertificates", lockAtLeastFor = "PT0S",
Expand Down

0 comments on commit 15313c6

Please sign in to comment.