/** {@inheritDoc} */
  @Override
  public Collection<X509Certificate> getAllCertificates() {
    // get everything from the configuration service.... no caching here
    Collection<org.nhindirect.config.model.Certificate> certificates;
    try {
      certificates = certService.getAllCertificates();
    } catch (Exception e) {
      throw new NHINDException("WebService error getting all certificates: " + e.getMessage(), e);
    }

    // purge everything
    this.flush(true);

    if (certificates == null || certificates.isEmpty()) return Collections.emptyList();

    // convert to X509Certificates and store
    Collection<X509Certificate> retVal = new ArrayList<X509Certificate>();
    for (org.nhindirect.config.model.Certificate cert : certificates) {
      X509Certificate storeCert = certFromData(cert.getData());
      retVal.add(storeCert);

      // add to JCS and cache
      try {
        if (cache != null) cache.put(cert.getOwner(), retVal);
      } catch (CacheException e) {
        /*
         * TODO: handle exception
         */
      }
    }

    return retVal;
  }