Code example for Signature

Methods: verify

0
        n = signingSigns[0].sign(sigBytes, 0, 50);
 
        verifyingSign.update(message);
 
        try { 
            verifyingSign.verify(null, 0, n);
        } catch (IllegalArgumentException e) {}
 
        try { 
            verifyingSign.verify(sigBytes, -1, n);
        } catch (IllegalArgumentException e) {}
 
        try { 
            verifyingSign.verify(sigBytes, 0, -1);
        } catch (IllegalArgumentException e) {}
 
        try { 
            verifyingSign.verify(sigBytes, sigBytes.length - 10, 30);
        } catch (IllegalArgumentException e) {}
 
        try { 
            verifyingSign.verify(sigBytes, Integer.MAX_VALUE, n);
        } catch (SignatureException e) {}
 
        try { 
            verifyingSign.verify(sig, 0, n);
        } catch (SignatureException e) {}
 
        // if the method doesn't reset the expected result of verificaton is "true" 
 
        assertTrue("test failure : n=" + n, verifyingSign
                .verify(sigBytes, 0, n));
    } 
 
    /** 
     * The test is against the pair "sign(byte[],int,int) - verify(byte[],int,int)" method. 
     * It checks out that the "verify" method returns "true"