Code example for OAEPParameterSpec

Methods: getDigestAlgorithm, getMGFAlgorithm, getMGFParameters, getPSource

0
        } 
 
        try { 
            new OAEPParameterSpec(mdName, null, mgfSpec, pSrc);
            fail("NullPointerException should be thrown in the case of "
                    + "null mgfName."); 
        } catch (NullPointerException e) {
        } 
 
        try { 
            new OAEPParameterSpec(mdName, mgfName, mgfSpec, null);
            fail("NullPointerException should be thrown in the case of "
                    + "null pSrc."); 
        } catch (NullPointerException e) {
        } 
 
        assertTrue("The message digest algorithm name of "
                + "OAEPParameterSpec.DEFAULT field should be " + mdName,
                OAEPParameterSpec.DEFAULT.getDigestAlgorithm().equals(mdName));
 
        assertTrue("The mask generation function algorithm name of "
                + "OAEPParameterSpec.DEFAULT field should be " + mgfName,
                OAEPParameterSpec.DEFAULT.getMGFAlgorithm().equals(mgfName));
 
        assertTrue("The mask generation function parameters of "