use of eu.europa.esig.trustedlist.jaxb.tsl.ServiceSupplyPointsType in project ref-GemLibPki by gematik.
the class TucPki018VerifierTest method overwriteSspUrls.
@SneakyThrows
private static void overwriteSspUrls(final List<TspService> tspServiceList) {
final ServiceSupplyPointsType serviceSupplyPointsType = new ServiceSupplyPointsType();
final AttributedNonEmptyURIType newSspUrl = new AttributedNonEmptyURIType();
newSspUrl.setValue(ocspResponderMock.getSspUrl());
serviceSupplyPointsType.getServiceSupplyPoint().add(newSspUrl);
tspServiceList.forEach(tspService -> tspService.getTspServiceType().getServiceInformation().setServiceSupplyPoints(serviceSupplyPointsType));
}
use of eu.europa.esig.trustedlist.jaxb.tsl.ServiceSupplyPointsType in project ref-GemLibPki by gematik.
the class TspInformationProvider method getFirstServiceSupplyPointFromTspService.
/**
* Get OCSP responder URL from given TspService.
*
* @param tspService the given TspService
* @return ServiceSupplyPoint as string (URL)
* @throws GemPkiException exception thrown if service supply point is missing
*/
private String getFirstServiceSupplyPointFromTspService(final TspService tspService) throws GemPkiException {
final Optional<ServiceSupplyPointsType> serviceSupplyPointsType = Optional.ofNullable(tspService.getTspServiceType().getServiceInformation().getServiceSupplyPoints());
if (serviceSupplyPointsType.isEmpty()) {
throw new GemPkiException(productType, ErrorCode.TE_1026);
}
final String firstServiceSupplyPoint = serviceSupplyPointsType.get().getServiceSupplyPoint().get(0).getValue();
if (firstServiceSupplyPoint.isBlank()) {
throw new GemPkiException(productType, ErrorCode.TE_1026);
} else {
log.debug("Der erste ServiceSupplyPoint wurde ermittelt {}", firstServiceSupplyPoint);
return firstServiceSupplyPoint;
}
}
Aggregations