StringBuilder sb = new StringBuilder();
for (X509Certificate cert : certChain) {
sb.append(Certificates.toPem(cert));
}
SecretInfo secretInfo = new SecretInfo();
secretInfo.name = "Self signed certificate for " + subject;
secretInfo.algorithm = algorithm;
secretInfo.keySize = keySize;
secretInfo.subject = subject;