} catch (IOException ioe) { log.error("Error reading byte array for X509 certificate.", ioe);
    public static String getCertFingerprintAsString(byte[] ba) {        try {            X509Certificate cert = getCertfromByteArray(ba);            byte[] res = generateSHA1Fingerprint(cert.getEncoded());            return Hex.encode(res);        } catch (CertificateEncodingException cee) {            log.error("Error encoding X509 certificate.", cee);        } catch (CertificateException cee) {            log.error("Error decoding X509 certificate.", cee);        } catch (IOException ioe) {            log.error("Error reading byte array for X509 certificate.", ioe);        }        return null;    }