@Override
    @SuppressWarnings({"JdkObsolete", "JavaUtilDate"}) // Needed for API compatibility
    public void checkValidity(Date date) throws CertificateExpiredException,
            CertificateNotYetValidException {
        if (getNotBefore().compareTo(date) > 0) {
            throw new CertificateNotYetValidException("Certificate not valid until "
                    + getNotBefore().toString() + " (compared to " + date.toString() + ")");
        }

        if (getNotAfter().compareTo(date) < 0) {
            throw new CertificateExpiredException("Certificate expired at "
                    + getNotAfter().toString() + " (compared to " + date.toString() + ")");
        }
    }
An implementation of {@link X509Certificate} based on BoringSSL.
common/src/main/java/org/conscrypt/OpenSSLX509Certificate.java