Code example for MGF1ParameterSpec

0
     * Test #2 for <code>MGF1ParameterSpec</code> constructor<br> 
     * Assertion: <code>NullPointerException</code> if parameter is <code>null</code> 
     */ 
    public final void testMGF1ParameterSpec02() { 
        try { 
            new MGF1ParameterSpec(null);
            fail("NullPointerException has not been thrown");
        } catch (NullPointerException ok) {
        } 
    } 
 
    /** 
     * Test for <code>getDigestAlgorithm</code> method<br> 
     * Assertion: returns the algorithm name of the message 
     * digest used by the mask generation function 
     */ 
    public final void testGetDigestAlgorithm() { 
        MGF1ParameterSpec aps = new MGF1ParameterSpec(testAlgName);
        assertTrue(testAlgName.equals(aps.getDigestAlgorithm()));
    }