class KeyStoreCertSigner implements CertSigner, AutoCloseable {

    @Override
    public String generateX509Certificate(String csr, String keyUsage, int certExpiryMins) {
        int certExpiryTime = (certExpiryMins == 0) ? this.maxCertExpiryTimeMins : certExpiryMins;

        PKCS10CertificationRequest certReq = Crypto.getPKCS10CertRequest(csr);
        // keyUsage is ignored
        X509Certificate cert = Crypto.generateX509Certificate(certReq, caPrivateKey, caCertificate, certExpiryTime, false);

        return Crypto.convertToPEMFormat(cert);
    }

    public  KeyStoreCertSigner(X509Certificate caCertificate, PrivateKey caPrivateKey, int maxCertExpiryTimeMins);

}