X509Util x509Util = new X509Util();
List<String> x5cStrings = new ArrayList<String>(certificateChain.size());
for (X509Certificate cert : certificateChain)
{
String b64EncodedDer = x509Util.toPem(cert);
x5cStrings.add(b64EncodedDer);
}
params.put(X509_CERTIFICATE_CHAIN_PARAMETER, x5cStrings);
}