Java 8 CertificateException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 CertificateException class.

This code example shows how to use the following methods:
    throws CertificateException { 
    X509TrustManager tm = trustManagerRef.get();
    if (tm != null) {
      tm.checkClientTrusted(chain, authType);
    } else { 
      throw new CertificateException("Unknown client chain certificate: " +
                                     chain[0].toString());
    } 
  } 
 
  @Override 
  public void checkServerTrusted(X509Certificate[] chain, String authType)
    throws CertificateException { 
    X509TrustManager tm = trustManagerRef.get();
    if (tm != null) {
      tm.checkServerTrusted(chain, authType);
    } else { 
      throw new CertificateException("Unknown server chain certificate: " +
                                     chain[0].toString());
    } 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
        throws CertificateException, NoSuchAlgorithmException,  
            SignatureException, InvalidKeyException 
    { 
        if (!isAlgIdEqual(c.getSignatureAlgorithm(), c.getTBSCertificate().getSignature()))
        { 
            throw new CertificateException("signature algorithm in TBS cert not same as outer cert");
        } 
 
        DEREncodable params = c.getSignatureAlgorithm().getParameters();
 
        // TODO This should go after the initVerify? 
        X509SignatureUtil.setSignatureParameters(signature, params);
 
        signature.initVerify(key);
 
        signature.update(this.getTBSCertificate());
 
        if (!signature.verify(this.getSignature()))
        { 
            throw new InvalidKeyException("Public key presented not for certificate signature");
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getMessage
        { 
            return builder.build(validatingKeyInfo);
        } 
        catch (CertificateException e)
        { 
            throw new OperatorCreationException("Unable to process certificate: " + e.getMessage(), e);
        } 
    } 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getCause, getMessage
     * Assertion: constructs CertificateException when <code>cause</code> is 
     * null 
     */ 
    public void testCertificateException04() { 
        Throwable cause = null;
        CertificateException tE = new CertificateException(cause);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    } 
 
    /** 
     * Test for <code>CertificateException(Throwable)</code> constructor 
     * Assertion: constructs CertificateException when <code>cause</code> is 
     * not null 
     */ 
    public void testCertificateException05() { 
        CertificateException tE = new CertificateException(tCause);
        if (tE.getMessage() != null) {
            String toS = tCause.toString();
            String getM = tE.getMessage();
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
            try { 
                // Try Bouncy Castle if the current JVM didn't have sun.security.x509. 
                paths = BouncyCastleSelfSignedCertGenerator.generate(fqdn, keypair, random);
            } catch (Throwable t2) {
                logger.debug("Failed to generate a self-signed X.509 certificate using Bouncy Castle:", t2);
                throw new CertificateException(
                        "No provider succeeded to generate a self-signed certificate. " + 
                                "See debug log for the root cause."); 
            } 
        } 
 
        certificate = new File(paths[0]);
        privateKey = new File(paths[1]);
    } 
 
    /** 
     * Returns the generated X.509 certificate file in PEM format. 
     */ 
    public File certificate() {
        return certificate;
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 CertificateException Questions & Answers: