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; }
/** * Create an instance of {@link XmlTrustedServiceProvider } * */ public XmlTrustedServiceProvider createXmlTrustedServiceProvider() { return new XmlTrustedServiceProvider(); }
List<XmlTrustAnchor> trustAnchors = new ArrayList<XmlTrustAnchor>(); for (XmlTrustedServiceProvider xmlTrustedServiceProvider : trustServiceProviders) { List<XmlTrustedService> trustedServices = xmlTrustedServiceProvider.getTrustedServices(); Set<String> uniqueServiceNames = getUniqueServiceNames(trustedServices); for (String serviceName : uniqueServiceNames) { XmlTrustAnchor trustAnchor = new XmlTrustAnchor(); trustAnchor.setCountryCode(xmlTrustedServiceProvider.getCountryCode()); trustAnchor.setTrustServiceProvider(xmlTrustedServiceProvider.getTSPName()); trustAnchor.setTrustServiceProviderRegistrationId(xmlTrustedServiceProvider.getTSPRegistrationIdentifier()); trustAnchor.setTrustServiceName(serviceName); trustAnchors.add(trustAnchor);
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; }
public Date getCertificateTSPServiceExpiredCertsRevocationInfo() { List<XmlTrustedServiceProvider> trustedServiceProviders = certificate.getTrustedServiceProviders(); if (Utils.isCollectionNotEmpty(trustedServiceProviders)) { for (XmlTrustedServiceProvider trustedServiceProvider : trustedServiceProviders) { List<XmlTrustedService> trustedServices = trustedServiceProvider.getTrustedServices(); for (XmlTrustedService xmlTrustedService : trustedServices) { if (xmlTrustedService.getExpiredCertsRevocationInfo() != null) { return xmlTrustedService.getExpiredCertsRevocationInfo(); // TODO improve } } } } return null; }