throw new InvalidAlgorithmParameterException("No supported AlgorithmParameterSpec for RC2 parameter generation.");
}
protected AlgorithmParameters engineGenerateParameters()
{
AlgorithmParameters params;
if (spec == null)
{
byte[] iv = new byte[8];
if (random == null)
{
random = new SecureRandom();
}
random.nextBytes(iv);
try
{
params = AlgorithmParameters.getInstance("RC2", "BC");
params.init(new IvParameterSpec(iv));
}
catch (Exception e)
{
throw new RuntimeException(e.getMessage());
}
}
else
{
try
{
params = AlgorithmParameters.getInstance("RC2", "BC");
params.init(spec);
}
catch (Exception e)
{
throw new RuntimeException(e.getMessage());
}