class ZTSUtils {

    public static Identity generateIdentity(InstanceCertManager certManager, final String csr,
            final String cn, final String certUsage, int expiryTime) {
        
        // generate a certificate for this certificate request

        String pemCert = certManager.generateX509Certificate(csr, certUsage, expiryTime);
        if (pemCert == null || pemCert.isEmpty()) {
            return null;
        }
        
        return new Identity().setName(cn).setCertificate(pemCert);
    }

}