Code example for DSAParameterSpec

0
        public MyDSA(DSAParams dsaParams) {
            super(dsaParams);
        } 
    } 
     
    /** 
     * @tests java.security.interfaces.DSAKeyPairGenerator 
     * #initialize(DSAParams params, SecureRandom random) 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "initialize", 
        args = {java.security.interfaces.DSAParams.class, java.security.SecureRandom.class}
    ) 
    public void test_DSAKeyPairGenerator01() { 
        DSAParams dsaParams = new DSAParameterSpec(p, q, g);
        SecureRandom random = null;
        MyDSA dsa = new MyDSA(dsaParams);
        try { 
            random = SecureRandom.getInstance("SHA1PRNG");
        } catch (Exception e) {
            fail("Unexpected exception for SecureRandom: " + e);
        } 
         
        try { 
            dsa.initialize(dsaParams, random);