Package java.security.cert

Examples of java.security.cert.X509Certificate.checkValidity()


      }
    }
    if ((certificates != null) && (certificates.length == 1))
    {
      X509Certificate certificate = certificates[0];
      certificate.checkValidity();
    }
    else
    {
      standardTrustManager.checkServerTrusted(certificates, authType);
    }
View Full Code Here


               (X509Certificate) cf.generateCertificate(fis);

            fis.close();

            //add to ArrayList
            cert.checkValidity();
            this._certs.add(cert);

            dn = cert.getSubjectDN().getName();
            added = true;
         } catch (FileNotFoundException ex) {
View Full Code Here

    }
    if (certificates != null) {
      for (int i = 0; i < certificates.length; i++) {
        X509Certificate certificate = certificates[i];
        try {
          certificate.checkValidity();
        } catch (CertificateException e) {
          LOG.error(e.toString());
          throw e;
        }
      }
View Full Code Here

            }
        }
        if ((certificates != null) && (certificates.length == 1)) {
            X509Certificate certificate = certificates[0];
            try {
                certificate.checkValidity();
            }
            catch (CertificateException e) {
                LOG.error(e.toString());
                return false;
            }
View Full Code Here

      keyStoreManager.getCertificateByHostname(hostname);
     
      // use this since getCertificateByHostname always returns null, but hostname == alias for our purpose
      X509Certificate cert = keyStoreManager.getCertificateByAlias(hostname);
      try {
        cert.checkValidity();
      } catch (CertificateExpiredException cee) {
        // if the cert is expired we should destroy it and recursively call this function
        keyStoreManager = null;
        FileUtils.deleteDirectory(root);
       
View Full Code Here

            {
                try
                {
                    if (check)
                    {
                        certificate.checkValidity();
                    }

                    chain.add(certificate);
                }
                catch (CertificateException ex)
View Full Code Here

                if (cert.equals(trustedCaCert))
                {
                    try
                    {
                        cert.checkValidity();
                        trustedCaCert.checkValidity();
                        return true;
                    }
                    catch (CertificateException ex)
                    {
                        // Not much we can do
View Full Code Here

            {
                try
                {
                    cert.verify(trustedCaCert.getPublicKey());
                    cert.checkValidity();
                    trustedCaCert.checkValidity();
                    return true;
                }
                catch (Exception ex)
                {
                    m_logger.log(Logger.LOG_WARNING, "Invalid Certificate", ex);
View Full Code Here

        try
        {
            X509Certificate cert = certGen.generate(privKey);

            cert.checkValidity(new Date());

            cert.verify(pubKey);

            ByteArrayInputStream    bIn = new ByteArrayInputStream(cert.getEncoded());
            CertificateFactory      fact = CertificateFactory.getInstance("X.509", "BC");
View Full Code Here

        try
        {
            X509Certificate cert = certGen.generate(privKey);

            cert.checkValidity(new Date());

            cert.verify(pubKey);

            ByteArrayInputStream    bIn = new ByteArrayInputStream(cert.getEncoded());
            CertificateFactory      fact = CertificateFactory.getInstance("X.509", "BC");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.