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 } }
@Override public void setUp() throws Exception { timeSource = new FakeTimeSource(1233465103000L); // Jan 31, 2009 cache = new DefaultCacheImpl(timeSource); validator = new CachedCertPathValidator(cache, timeSource, new FakeTrustRootsProvider(CertConstantUtil.CA_PUB_CERT)); }
@Override public void setUp() throws Exception { timeSource = new FakeTimeSource(1233465103000L); // Jan 31, 2009 cache = new DefaultCacheImpl(timeSource); validator = new CachedCertPathValidator(cache, timeSource, new FakeTrustRootsProvider(CertConstantUtil.CA_PUB_CERT)); }
@Override protected void setUp() throws Exception { super.setUp(); // Jan 31, 2009 FakeTimeSource timeSource = new FakeTimeSource(1233465103000L); DefaultCacheImpl cache = new DefaultCacheImpl(timeSource); CachedCertPathValidator validator = new CachedCertPathValidator(cache, timeSource, new FakeTrustRootsProvider(CertConstantUtil.CA_PUB_CERT)); store = new DefaultCertPathStore(); verifier = new WaveSignatureVerifier(validator, store); }
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 } }
@Override protected void setUp() throws Exception { super.setUp(); // Jan 31, 2009 FakeTimeSource timeSource = new FakeTimeSource(1233465103000L); DefaultCacheImpl cache = new DefaultCacheImpl(timeSource); CachedCertPathValidator validator = new CachedCertPathValidator(cache, timeSource, new FakeTrustRootsProvider(CertConstantUtil.CA_PUB_CERT)); store = new DefaultCertPathStore(); verifier = new WaveSignatureVerifier(validator, store); }