Code example for MGF1ParameterSpec

Methods: getDigestAlgorithm

0
     * 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()));
    } 
 
    /** 
     * Test for public static fields and <code>getDigestAlgorithm</code> method<br> 
     * Assertion: returns the algorithm name of the message 
     * digest used by the mask generation function 
     */ 
    public final void testFieldsGetDigestAlgorithm() { 
        assertEquals("SHA-1", MGF1ParameterSpec.SHA1.getDigestAlgorithm());
        assertEquals("SHA-256", MGF1ParameterSpec.SHA256.getDigestAlgorithm());
        assertEquals("SHA-384", MGF1ParameterSpec.SHA384.getDigestAlgorithm());
        assertEquals("SHA-512", MGF1ParameterSpec.SHA512.getDigestAlgorithm());
    } 
}