public void testVerify() throws Exception { validator.validate(serverChain); }
public void testVerify() throws Exception { validator.validate(serverChain); }
public void testSpeed() throws Exception { long start = System.currentTimeMillis(); long ops = 0; while (System.currentTimeMillis() < start + 1000L) { validator.validate(serverChain); ++ops; } long stop = System.currentTimeMillis(); System.out.println(ops/(stop-start) + " ops per ms"); } }
public void testSpeed() throws Exception { long start = System.currentTimeMillis(); long ops = 0; while (System.currentTimeMillis() < start + 1000L) { validator.validate(serverChain); ++ops; } long stop = System.currentTimeMillis(); System.out.println(ops/(stop-start) + " ops per ms"); } }
public void testOutOfOrder() throws Exception { try { validator.validate(Lists.newArrayList( CertConstantUtil.INTERMEDIATE_PUB_CERT, CertConstantUtil.SERVER_PUB_CERT)); fail("Should have thrown, certs out of order"); } catch (SignatureException e) { // good } }
public void testOutOfOrder() throws Exception { try { validator.validate(Lists.newArrayList( CertConstantUtil.INTERMEDIATE_PUB_CERT, CertConstantUtil.SERVER_PUB_CERT)); fail("Should have thrown, certs out of order"); } catch (SignatureException e) { // good } }
public void testIncomplete() throws Exception { try { validator.validate(Lists.newArrayList(CertConstantUtil.SERVER_PUB_CERT)); fail("Should have thrown, cert chain incomplete."); } catch (SignatureException e) { // good } }
public void testIncomplete() throws Exception { try { validator.validate(Lists.newArrayList(CertConstantUtil.SERVER_PUB_CERT)); fail("Should have thrown, cert chain incomplete."); } catch (SignatureException e) { // good } }
public void testExpired() throws Exception { timeSource.advanceSeconds(1800L * 24 * 60 * 60); // 1800 days validator.validate(serverChain); timeSource.advanceSeconds(2000L * 24 * 60 * 60); // 2000 days try { validator.validate(serverChain); fail("Should have thrown, cert expired"); } catch (SignatureException e) { // good } }
public void testExpired() throws Exception { timeSource.advanceSeconds(1800L * 24 * 60 * 60); // 1800 days validator.validate(serverChain); timeSource.advanceSeconds(2000L * 24 * 60 * 60); // 2000 days try { validator.validate(serverChain); fail("Should have thrown, cert expired"); } catch (SignatureException e) { // good } }