Java 类org.bouncycastle.asn1.ASN1Exception 实例源码

项目:irma_future_id    文件:OCSPTest.java   
public void testInvalidResp()
    throws Exception
{
    try
    {
        OCSPResp response = new OCSPResp(invalidResp);
    }
    catch (CertIOException e)
    {
        if (e.getCause() instanceof ASN1Exception)
        {
            Throwable c = ((ASN1Exception)e.getCause()).getCause();

            if (!c.getMessage().equals("ENUMERATED has zero length"))
            {
                fail("parsing failed, but for wrong reason: " + c.getMessage());
            }
        }
        else
        {
            fail("parsing failed, but for wrong reason: " + e.getMessage());
        }
    }


}
项目:bc-java    文件:OCSPTest.java   
public void testInvalidResp()
    throws Exception
{
    try
    {
        OCSPResp response = new OCSPResp(invalidResp);
    }
    catch (CertIOException e)
    {
        if (e.getCause() instanceof ASN1Exception)
        {
            Throwable c = ((ASN1Exception)e.getCause()).getCause();

            if (!c.getMessage().equals("ENUMERATED has zero length"))
            {
                fail("parsing failed, but for wrong reason: " + c.getMessage());
            }
        }
        else
        {
            fail("parsing failed, but for wrong reason: " + e.getMessage());
        }
    }


}