Code example for DHParameterSpec

0
currentSpec = new DHParameterSpec(dhP.getP(), dhP.getG(), dhP.getL().intValue());
                } 
                else 
                { 
                    currentSpec = new DHParameterSpec(dhP.getP(), dhP.getG());
                } 
            } 
            catch (ClassCastException e)
            { 
                throw new IOException("Not a valid DH Parameter encoding.");
            } 
            catch (ArrayIndexOutOfBoundsException e)
            { 
                throw new IOException("Not a valid DH Parameter encoding.");
            } 
        } 
 
        protected void engineInit( 
            byte[] params,
            String format)