Package java.security.cert

Examples of java.security.cert.CertificateNotYetValidException


    public static String[] msgs = {
            "New message",
            "Long message for Exception. Long message for Exception. Long message for Exception." };

    protected Object[] getData() {
        return new Object[] { new CertificateNotYetValidException(),
                new CertificateNotYetValidException(null),
                new CertificateNotYetValidException(msgs[1])};
    }
View Full Code Here


     * Test for <code>CertificateNotYetValidException()</code> constructor
     * Assertion: constructs CertificateNotYetValidException with no detail
     * message
     */
    public void testCertificateNotYetValidException01() {
        CertificateNotYetValidException tE = new CertificateNotYetValidException();
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    }
View Full Code Here

     * Test for <code>CertificateNotYetValidException(String)</code>
     * constructor Assertion: constructs CertificateNotYetValidException with
     * detail message msg. Parameter <code>msg</code> is not null.
     */
    public void testCertificateNotYetValidException02() {
        CertificateNotYetValidException tE;
        for (int i = 0; i < msgs.length; i++) {
            tE = new CertificateNotYetValidException(msgs[i]);
            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
                    .getMessage(), msgs[i]);
            assertNull("getCause() must return null", tE.getCause());
        }
    }
View Full Code Here

     * constructor Assertion: constructs CertificateNotYetValidException when
     * <code>msg</code> is null
     */
    public void testCertificateNotYetValidException03() {
        String msg = null;
        CertificateNotYetValidException tE = new CertificateNotYetValidException(
                msg);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    }
View Full Code Here

            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 for <code>CertificateNotYetValidException()</code> constructor
     * Assertion: constructs CertificateNotYetValidException with no detail
     * message
     */
    public void testCertificateNotYetValidException01() {
        CertificateNotYetValidException tE = new CertificateNotYetValidException();
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    }
View Full Code Here

     * Test for <code>CertificateNotYetValidException(String)</code>
     * constructor Assertion: constructs CertificateNotYetValidException with
     * detail message msg. Parameter <code>msg</code> is not null.
     */
    public void testCertificateNotYetValidException02() {
        CertificateNotYetValidException tE;
        for (int i = 0; i < msgs.length; i++) {
            tE = new CertificateNotYetValidException(msgs[i]);
            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
                    .getMessage(), msgs[i]);
            assertNull("getCause() must return null", tE.getCause());
        }
    }
View Full Code Here

     * constructor Assertion: constructs CertificateNotYetValidException when
     * <code>msg</code> is null
     */
    public void testCertificateNotYetValidException03() {
        String msg = null;
        CertificateNotYetValidException tE = new CertificateNotYetValidException(
                msg);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    }
View Full Code Here

    public static String[] msgs = {
            "New message",
            "Long message for Exception. Long message for Exception. Long message for Exception." };

    protected Object[] getData() {
        return new Object[] { new CertificateNotYetValidException(),
                new CertificateNotYetValidException(null),
                new CertificateNotYetValidException(msgs[1])};
    }
View Full Code Here

  Calendar now = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
  now.setTime(date);

  if (now.before(tbsCertificate_.getNotBefore()))
      throw new CertificateNotYetValidException(
        "Certificate is not valid yet!");

  if (now.after(tbsCertificate_.getNotAfter()))
      throw new CertificateExpiredException("Certificate is expired");
View Full Code Here

TOP

Related Classes of java.security.cert.CertificateNotYetValidException

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.