Package java.security.cert

Examples of java.security.cert.CertificateExpiredException


        Date    date)
        throws CertificateExpiredException, CertificateNotYetValidException
    {
        if (date.after(this.getNotAfter()))
        {
            throw new CertificateExpiredException("certificate expired on " + c.getEndDate().getTime());
        }

        if (date.before(this.getNotBefore()))
        {
            throw new CertificateNotYetValidException("certificate not valid till " + c.getStartDate().getTime());
View Full Code Here


    }

    @Test
    public void testExpiredCertificate() throws Exception {
        this.enableTLS = true;
        doThrow(new CertificateExpiredException()).when(mockCertificateExpired).checkValidity();
        when(mockRequest.getAttribute("javax.servlet.request.X509Certificate")).
                thenReturn(new X509Certificate[]{mockCertificateExpired});
        doFilter(mockRequest, mockResponseExpired, mockChain);
        verify(mockResponseExpired).sendError(Response.Status.FORBIDDEN.getStatusCode(),
                "Request not authorized, valid certificates not presented");
View Full Code Here

          if (end.before(date)) {
            String msg = "Certificate endDate '"+end+"' is before check date '"+date+"'";
            if (log.isTraceEnabled()) {
              log.trace(msg);
            }
            throw new CertificateExpiredException(msg);
          }
        } catch (NoSuchFieldException e) {
                log.error("NoSuchFieldException: ", e);
        }
      }       
View Full Code Here

        long time = System.currentTimeMillis();
        if (time < notBefore) {
            throw new CertificateNotYetValidException();
        }
        if (time > notAfter) {
            throw new CertificateExpiredException();
        }
    }
View Full Code Here

        long time = date.getTime();
        if (time < notBefore) {
            throw new CertificateNotYetValidException();
        }
        if (time > notAfter) {
            throw new CertificateExpiredException();
        }
    }
View Full Code Here

        Date    date)
        throws CertificateExpiredException, CertificateNotYetValidException
    {
        if (date.after(this.getNotAfter()))
        {
            throw new CertificateExpiredException("certificate expired on " + this.getNotAfter());
        }

        if (date.before(this.getNotBefore()))
        {
            throw new CertificateNotYetValidException("certificate not valid till " + this.getNotBefore());
View Full Code Here

        }

        public void checkValidity(Date arg0)
            throws CertificateExpiredException, CertificateNotYetValidException {
            if (!this.valid) {
                throw new CertificateExpiredException();
            }
        }
View Full Code Here

        Date    date)
        throws CertificateExpiredException, CertificateNotYetValidException
    {
        if (date.getTime() > this.getNotAfter().getTime())  // for other VM compatibility
        {
            throw new CertificateExpiredException("certificate expired on " + c.getEndDate().getTime());
        }

        if (date.getTime() < this.getNotBefore().getTime())
        {
            throw new CertificateNotYetValidException("certificate not valid till " + c.getStartDate().getTime());
View Full Code Here

        Date    date)
        throws CertificateExpiredException, CertificateNotYetValidException
    {
        if (date.after(this.getNotAfter()))
        {
            throw new CertificateExpiredException("certificate expired on " + c.getEndDate().getTime());
        }

        if (date.before(this.getNotBefore()))
        {
            throw new CertificateNotYetValidException("certificate not valid till " + c.getStartDate().getTime());
View Full Code Here

        Date    date)
        throws CertificateExpiredException, CertificateNotYetValidException
    {
        if (date.after(this.getNotAfter()))
        {
            throw new CertificateExpiredException("certificate expired on " + c.getEndDate().getTime());
        }

        if (date.before(this.getNotBefore()))
        {
            throw new CertificateNotYetValidException("certificate not valid till " + c.getStartDate().getTime());
View Full Code Here

TOP

Related Classes of java.security.cert.CertificateExpiredException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.