class HttpCertSigner implements CertSigner {

    @Override
    public String generateX509Certificate(String csr, String keyUsage, int expireMins) {
        
        // Key Usage value used in Go - https://golang.org/src/crypto/x509/x509.go?s=18153:18173#L558
        // we're only interested in ExtKeyUsageClientAuth - with value of 2
        
        List<Integer> extKeyUsage = null;
        if (InstanceProvider.ZTS_CERT_USAGE_CLIENT.equals(keyUsage)) {
            extKeyUsage = new ArrayList<>();
            extKeyUsage.add(2);
        }

        ContentResponse response = null;
        for (int i = 0; i < requestRetryCount; i++) {
            response = processX509CertRequest(csr, extKeyUsage, expireMins, i + 1);
            if (response != null) {
                break;
            }
        }
        if (response == null) {
            return null;
        }
        
        if (response.getStatus() != HttpStatus.CREATED_201) {
            LOGGER.error("unable to fetch requested uri '" + x509CertUri +
                    "' status: " + response.getStatus());
            return null;
        }

        String data = response.getContentAsString();
        if (data == null || data.isEmpty()) {
            LOGGER.error("received empty response from uri '" + x509CertUri +
                    "' status: " + response.getStatus());
            return null;
        }

        X509CertSignObject pemCert = JSON.fromString(data, X509CertSignObject.class);
        return (pemCert != null) ? pemCert.getPem() : null;
    }

    public  HttpCertSigner();

}