class ClientUtils {

    public static boolean hasValidLocalSignCert(ClientId clientId, List<CertificateInfo> certificateInfos) {
        for (CertificateInfo certificateInfo : certificateInfos) {
            String ocspResponseStatus = null;
            try {
                ocspResponseStatus = OcspUtils.getOcspResponseStatus(certificateInfo.getOcspBytes());
            } catch (OcspUtils.OcspStatusExtractionException | RuntimeException e) {
                log.error(ERROR_OCSP_EXTRACT_MSG + " for client: " + clientId.toString(), e);
                return false;
            }
            if (clientId.memberEquals(certificateInfo.getMemberId())
                    && certificateInfo.getStatus().equals(CertificateInfo.STATUS_REGISTERED)
                    && ocspResponseStatus.equals(CertificateInfo.OCSP_RESPONSE_GOOD)) {
                return true;
            }
        }
        return false;
    }

    private  ClientUtils();

}