boolean ret = false;  X509Certificate cert = (X509Certificate) CertTools.getCertfromByteArray(testcert);
X509Certificate cert = CertTools.getCertfromByteArray(testcert);
    public void test03FindHardTokenByCertificate() throws Exception {        log.debug(">test03FindHardTokenByCertificate()");        boolean ret = false;                       X509Certificate cert = (X509Certificate) CertTools.getCertfromByteArray(testcert);        // Store the dummy cert for test.          if(certStore.findCertificateByFingerprint(admin, CertTools.getFingerprintAsString(cert)) == null){          certStore.storeCertificate(admin,cert,"DUMMYUSER", CertTools.getFingerprintAsString(cert),CertificateDataBean.CERT_ACTIVE,CertificateDataBean.CERTTYPE_ENDENTITY);        }        String tokensn = cacheAdmin.findHardTokenByCertificateSNIssuerDN(admin, cert.getSerialNumber(), cert.getIssuerDN().toString());;                assertTrue("Couldn't find right hardtokensn", tokensn.equals("1234"));        log.debug("<test03FindHardTokenByCertificate()");    }