Code example for Signature

Methods: verify

0
 
        byte bArray[] = new byte[100];
 
        // case1 : null byte array 
        try { 
            verifyingSign.verify(null, 0, 48);
            fail("case1 : no IllegalArgumentException");
        } catch (IllegalArgumentException e) {}
 
        // case2 : len < 0 
        try { 
            verifyingSign.verify(bArray, 0, -1);
            fail("case2 : no IllegalArgumentException");
        } catch (IllegalArgumentException e) {}
 
        // case3 : offset < 0 
        try { 
            verifyingSign.verify(bArray, -1, 48);
            fail("case3: no IllegalArgumentException");
        } catch (IllegalArgumentException e) {}
 
        // case4 : offset+len > outbuf.length 
        try { 
            int k = bArray.length / 2;
            verifyingSign.verify(bArray, k, bArray.length - k + 1);
            fail("case4: no IllegalArgumentException");
        } catch (IllegalArgumentException e) {}
    } 
 
    /**