code: @SneakyThrows
      protected Pair<String, String> generateCertificateAndKey() {
          try (val certWriter = new StringWriter(); val keyWriter = new StringWriter()) {
              samlIdPMetadataGeneratorConfigurationContext.getSamlIdPCertificateAndKeyWriter().writeCertificateAndKey(keyWriter, certWriter);
              val encryptionKey = samlIdPMetadataGeneratorConfigurationContext.getMetadataCipherExecutor().encode(keyWriter.toString());
              return Pair.of(certWriter.toString(), encryptionKey);
          }
      }
docs: Generate certificate and key pair.
  
  @return the pair where key/left is the certificate and value is the key