Code example for PBEParameterSpec

0
            } 
             
            if (k.getParam() != null)
            { 
                param = k.getParam();
                pbeSpec = new PBEParameterSpec(k.getSalt(), k.getIterationCount());
            } 
            else if (params instanceof PBEParameterSpec)
            { 
                pbeSpec = (PBEParameterSpec)params;
                param = PBE.Util.makePBEParameters(k, params, cipher.getUnderlyingCipher().getAlgorithmName());
            } 
            else 
            { 
                throw new InvalidAlgorithmParameterException("PBE requires PBE parameters to be set.");
            } 
 
            if (param instanceof ParametersWithIV)
            { 
                ivParam = (ParametersWithIV)param;
            }