public Set<String> getTrustedListCountryCodes() { Set<String> countryCodes = new HashSet<String>(); List<XmlTrustedServiceProvider> trustedServiceProviders = certificate.getTrustedServiceProviders(); for (XmlTrustedServiceProvider tsp : trustedServiceProviders) { countryCodes.add(tsp.getCountryCode()); } return countryCodes; }
public List<TrustedServiceWrapper> getTrustedServices() { List<TrustedServiceWrapper> result = new ArrayList<TrustedServiceWrapper>(); List<XmlTrustedServiceProvider> tsps = certificate.getTrustedServiceProviders(); if (Utils.isCollectionNotEmpty(tsps)) { for (XmlTrustedServiceProvider tsp : tsps) { List<XmlTrustedService> trustedServices = tsp.getTrustedServices(); if (Utils.isCollectionNotEmpty(trustedServices)) { for (XmlTrustedService trustedService : trustedServices) { TrustedServiceWrapper wrapper = new TrustedServiceWrapper(); wrapper.setTspName(tsp.getTSPName()); wrapper.setServiceName(trustedService.getServiceName()); wrapper.setCountryCode(tsp.getCountryCode()); wrapper.setStatus(trustedService.getStatus()); wrapper.setType(trustedService.getServiceType()); wrapper.setStartDate(trustedService.getStartDate()); wrapper.setEndDate(trustedService.getEndDate()); wrapper.setCapturedQualifiers(new ArrayList<String>(trustedService.getCapturedQualifiers())); wrapper.setAdditionalServiceInfos(new ArrayList<String>(trustedService.getAdditionalServiceInfoUris())); result.add(wrapper); } } } } return result; }
for (String serviceName : uniqueServiceNames) { XmlTrustAnchor trustAnchor = new XmlTrustAnchor(); trustAnchor.setCountryCode(xmlTrustedServiceProvider.getCountryCode()); trustAnchor.setTrustServiceProvider(xmlTrustedServiceProvider.getTSPName()); trustAnchor.setTrustServiceProviderRegistrationId(xmlTrustedServiceProvider.getTSPRegistrationIdentifier());