Code example for OAEPParameterSpec

Methods: getMGFParameters

0
     * getMGFAlgorithm() method testing. 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "getMGFAlgorithm", 
        args = {} 
    ) 
    public void testGetMGFAlgorithm() { 
        String mdName = "SHA-1";
        String mgfName = "MGF1";
        AlgorithmParameterSpec mgfSpec = MGF1ParameterSpec.SHA1;
        PSource pSrc = PSource.PSpecified.DEFAULT;
 
        OAEPParameterSpec ps = new OAEPParameterSpec(mdName, mgfName,
                                                                mgfSpec, pSrc);
        assertTrue("The returned value does not equal to the "
                + "value specified in the constructor.", 
                ps.getMGFAlgorithm().equals(mgfName));
    }