class TokenCertificateConverter {

    public TokenCertificate convert(CertificateInfo certificateInfo) {
        TokenCertificate tokenCertificate = new TokenCertificate();

        tokenCertificate.setActive(certificateInfo.isActive());
        tokenCertificate.setCertificateDetails(certificateDetailsConverter.convert(certificateInfo));
        if (certificateInfo.getMemberId() != null) {
            tokenCertificate.setOwnerId(clientConverter.convertId(certificateInfo.getMemberId()));
        }
        tokenCertificate.setOcspStatus(getOcspStatus(certificateInfo,
                tokenCertificate.getCertificateDetails()));
        tokenCertificate.setSavedToConfiguration(certificateInfo.isSavedToConfiguration());
        tokenCertificate.setStatus(CertificateStatusMapping.map(certificateInfo.getStatus())
                                           .orElse(null));
        return tokenCertificate;
    }

    @Autowired public  TokenCertificateConverter(CertificateDetailsConverter certificateDetailsConverter,
            ClientConverter clientConverter);

}