private static void generateRandomCertsAndKeys(StringBuilder content) throws IOException {
        int keySize = Optional.ofNullable(System.getenv("RSA_KEY_SIZE"))
                              .map(Integer::valueOf)
                              .orElse(2048);

        KeyPair keyPair = KeyUtils.generateRsaKeyPair(keySize);
        X509Certificate certificate = CertificateUtils.generateV1SelfSignedCertificate(keyPair, "apiman");
        String privateKeyPem = PemUtils.encodeKey(keyPair.getPrivate());
        String publicKeyPem = PemUtils.encodeKey(keyPair.getPublic());
        String certPem = PemUtils.encodeCertificate(certificate);

        Files.writeString(Paths.get("data/keys/apiman-private-key.pem"), privateKeyPem, StandardOpenOption.CREATE_NEW);
        Files.writeString(Paths.get("data/keys/apiman-public-key.pem"), publicKeyPem, StandardOpenOption.CREATE_NEW);
        Files.writeString(Paths.get("data/keys/apiman-self-signed-cert.pem"), certPem, StandardOpenOption.CREATE_NEW);

        insertValue(content, "KEYCLOAK_REALM_PRIVATE_KEY=", privateKeyPem);
        insertValue(content, "KEYCLOAK_REALM_PUBLIC_KEY=", publicKeyPem);
        insertValue(content, "KEYCLOAK_REALM_CERTIFICATE=", certPem);
    }
Set up docker-compose project.

Run as `jbang setup.java`.

@author Marc Savy {@literal <marc@blackparrotlabs.io>}
containers/docker-compose/src/docker/setup.java