@Override
protected Message run0() throws Exception {
Auth auth = getAuth();
Project project = auth.getProject();
SelfSigned helper = new SelfSigned();
int keySize = 2048;
String algorithm = "rsa";
KeyPair keyPair = KeyPairs.generateKeyPair(algorithm, keySize);
Csr csr = helper.buildCsr(keyPair, subject);
List<X509Certificate> certChain = helper.selfSign(csr, keyPair);
StringBuilder sb = new StringBuilder();
for (X509Certificate cert : certChain) {
sb.append(Certificates.toPem(cert));
}