Code example for IvParameterSpec

Methods: getIV

0
        { 
            if (ivLength != 0)
            { 
                IvParameterSpec p = (IvParameterSpec)params;
 
                if (p.getIV().length != ivLength && !isAEADModeName(modeName))
                { 
                    throw new InvalidAlgorithmParameterException("IV must be " + ivLength + " bytes long.");
                } 
 
                if (key instanceof RepeatedSecretKeySpec)
                { 
                    param = new ParametersWithIV(null, p.getIV());
                    ivParam = (ParametersWithIV)param;
                } 
                else 
                { 
                    param = new ParametersWithIV(new KeyParameter(key.getEncoded()), p.getIV());
                    ivParam = (ParametersWithIV)param;
                } 
            } 
            else 
            {