Code example for DHParameterSpec

Methods: getGgetLgetP

0
        { 
            throw new InvalidAlgorithmParameterException("parameter object not a DHParameterSpec");
        } 
        DHParameterSpec dhParams = (DHParameterSpec)params;
 
        param = new DHKeyGenerationParameters(random, new DHParameters(dhParams.getP(), dhParams.getG(), null, dhParams.getL()));
 
        engine.init(param);
        initialised = true;
    } 
 
    public KeyPair generateKeyPair()
    { 
        if (!initialised)
        { 
            Integer paramStrength = Integers.valueOf(strength);
 
            if (params.containsKey(paramStrength))
            { 
                param = (DHKeyGenerationParameters)params.get(paramStrength);
            }