Code example for RC2ParameterSpec

Methods: getIV

0
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "RC2ParameterSpec", 
        args = {int.class, byte[].class, int.class} 
    ) 
    public void testRC2ParameterSpec2() { 
        int effectiveKeyBits = 10;
        byte[] iv = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
        int offset = 2;
 
        try { 
            new RC2ParameterSpec(effectiveKeyBits, null, offset);
            fail("An IllegalArgumentException should be thrown "
                    + "in the case of null iv."); 
        } catch (IllegalArgumentException e) {
        } 
 
        try { 
            new RC2ParameterSpec(effectiveKeyBits, iv, 4);
            fail("An IllegalArgumentException should be thrown "
                    + "in the case of short iv.");