Java 8 CertificateParsingException - 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 CertificateParsingException class.

This code example shows how to use the following methods:getCause, getMessage
     * Test for <code>CertificateParsingException(Throwable)</code> 
     * constructor Assertion: constructs CertificateParsingException when 
     * <code>cause</code> is not null 
     */ 
    public void testCertificateParsingException05() { 
        CertificateParsingException tE = new CertificateParsingException(tCause);
        if (tE.getMessage() != null) {
            String toS = tCause.toString();
            String getM = tE.getMessage();
            assertTrue("getMessage() should contain ".concat(toS), (getM
                    .indexOf(toS) != -1));
        } 
        assertNotNull("getCause() must not return null", tE.getCause());
        assertEquals("getCause() must return ".concat(tCause.toString()), tE
                .getCause(), tCause);
    } 
 
    /** 
     * Test for <code>CertificateParsingException(String, Throwable)</code> 
     * constructor Assertion: constructs CertificateParsingException when 
6
CodeRank
This code example shows how to use the following methods:getCause, getMessage
     * Assertion: constructs CertificateParsingException when <code>msg</code> 
     * is null 
     */ 
    public void testCertificateParsingException03() { 
        String msg = null;
        CertificateParsingException tE = new CertificateParsingException(msg);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    } 
 
    /** 
     * Test for <code>CertificateParsingException(Throwable)</code> 
     * constructor Assertion: constructs CertificateParsingException when 
     * <code>cause</code> is null 
     */ 
    public void testCertificateParsingException04() { 
        Throwable cause = null;
        CertificateParsingException tE = new CertificateParsingException(cause);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
6
CodeRank
This code example shows how to use the following methods:
    protected Object[] getData() { 
        Exception cause = new Exception(msgs[1]); 
        CertificateParsingException dExc = new CertificateParsingException(msgs[0], cause); 
        String msg = null; 
        Throwable th = null; 
        return new Object[] { new CertificateParsingException(), new CertificateParsingException(msg), 
                new CertificateParsingException(msgs[1]), 
                new CertificateParsingException(new Throwable()), new CertificateParsingException(th), 
                new CertificateParsingException(msgs[1], dExc) }; 
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:
    { 
        byte[] extValue = cert.getExtensionValue(oid);
         
        if (extValue == null)
        { 
            throw new CertificateParsingException("extension " + oid + " not present");
        } 
         
        try 
        { 
            ASN1Encodable value = X509ExtensionUtil.fromExtensionValue(extValue);
     
            this.addExtension(oid, critical, value);
        } 
        catch (IOException e)
        { 
            throw new CertificateParsingException(e.toString());
        } 
    } 
 
5
CodeRank
This code example shows how to use the following methods:
 
            return (ASN1OctetString)(new SubjectKeyIdentifier(info).toASN1Object());
        } 
        catch (Exception e)
        { 
            throw new CertificateParsingException("Exception extracting certificate details: " + e.toString());
        } 
    } 
     
    public SubjectKeyIdentifierStructure( 
        PublicKey pubKey)
        throws CertificateParsingException 
    { 
        super(fromPublicKey(pubKey));
    } 
} 
4
CodeRank
This code example shows how to use the following methods:
     
            this.addExtension(oid, critical, value);
        } 
        catch (IOException e)
        { 
            throw new CertificateParsingException(e.toString());
        } 
    } 
 
    /** 
     * add a given extension field for the standard extensions tag (tag 3) 
     * copying the extension value from another certificate. 
     * @throws CertificateParsingException if the extension cannot be extracted. 
     */ 
    public void copyAndAddExtension( 
        DERObjectIdentifier oid,
        boolean             critical,
        X509Certificate     cert)
        throws CertificateParsingException 
    { 
4
CodeRank
This code example shows how to use the following methods:
        Exception cause = new Exception(msgs[1]); 
        CertificateParsingException dExc = new CertificateParsingException(msgs[0], cause); 
        String msg = null; 
        Throwable th = null; 
        return new Object[] { new CertificateParsingException(), new CertificateParsingException(msg), 
                new CertificateParsingException(msgs[1]), 
                new CertificateParsingException(new Throwable()), new CertificateParsingException(th), 
                new CertificateParsingException(msgs[1], dExc) }; 
    } 
 
    public static void main(String[] args) { 
        junit.textui.TestRunner.run(CertificateParsingExceptionTest.class); 
    } 
} 
4
CodeRank
This code example shows how to use the following methods:
 
            return (ASN1OctetString)(new SubjectKeyIdentifier(info).toASN1Object());
        } 
        catch (Exception e)
        { 
            throw new CertificateParsingException("Exception extracting certificate details: " + e.toString());
        } 
    } 
     
    public SubjectKeyIdentifierStructure( 
        PublicKey pubKey)
        throws CertificateParsingException 
    { 
        super(fromPublicKey(pubKey));
    } 
} 
4
CodeRank
This code example shows how to use the following methods:
                } 
                else 
                { 
                    logger.fatal((new StringBuilder()).append("Internal error: Invalid data type ").append(type)
                            .append(" when trying to read certificate").toString());
                    throw new CertificateParsingException((new StringBuilder()).append("Internal error: Invalid data type ").append(type)
                            .append(" when trying to read certificate").toString());
                } 
            } 
        } 
        return obj;
    } 
} 
3
CodeRank
This code example shows how to use the following methods:
            return null; 
        } 
        try { 
            return extensions.valueOfExtendedKeyUsage();
        } catch (IOException e) {
            throw new CertificateParsingException(e);
        } 
    } 
 
    public int getBasicConstraints() { 
        if (extensions == null) {
            return -1; 
        } 
        return extensions.valueOfBasicConstraints();
    } 
 
    public Collection<List<?>> getSubjectAlternativeNames() throws CertificateParsingException {
        if (extensions == null) {
            return null; 
        } 
4
CodeRank
See Code Examples for Java 8 CertificateParsingException Methods: