code: public static X500Principal[] getIssuerDNsFromChain(List<X509Certificate> chain)
  	{
  		if (chain == null || chain.isEmpty())
  			throw new IllegalArgumentException("Must provide a chain that is non-null and non-empty");
  
  		// Given a chain of n, there are n-1 values for "issuers" and 1 "subject"
  		final X500Principal[] issuers = new X500Principal[chain.size() - 1]; // Allocate array of n-1 for issuers
  
  		for (int i = 0; i < issuers.length; i++)
  		{
  			final X509Certificate certificate = chain.get(i);
  			final X500Principal subject = certificate.getSubjectX500Principal();
  
  			issuers[i] = subject;
  		}
  
  		return issuers;
  	}
docs: Extracts the DNs of the issuers from a certificate chain. The last certificate in the chain will be ignored (since it is
  the subject)
  
  @param chain
  a normalised chain
  
  @return