1package org.bouncycastle.jcajce.provider.symmetric.util; 2 3import java.security.AlgorithmParameterGeneratorSpi; 4import java.security.AlgorithmParameters; 5import java.security.NoSuchAlgorithmException; 6import java.security.NoSuchProviderException; 7import java.security.SecureRandom; 8 9// Android-changed: Use default provider for JCA algorithms instead of BC 10// Was: import org.bouncycastle.jcajce.util.BCJcaJceHelper; 11import org.bouncycastle.jcajce.util.DefaultJcaJceHelper; 12import org.bouncycastle.jcajce.util.JcaJceHelper; 13 14public abstract class BaseAlgorithmParameterGenerator 15 extends AlgorithmParameterGeneratorSpi 16{ 17 // Android-changed: Use default provider for JCA algorithms instead of BC 18 // Was: private final JcaJceHelper helper = new BCJcaJceHelper(); 19 private final JcaJceHelper helper = new DefaultJcaJceHelper(); 20 21 protected SecureRandom random; 22 protected int strength = 1024; 23 24 public BaseAlgorithmParameterGenerator() 25 { 26 } 27 28 protected final AlgorithmParameters createParametersInstance(String algorithm) 29 throws NoSuchAlgorithmException, NoSuchProviderException 30 { 31 return helper.createAlgorithmParameters(algorithm); 32 } 33 34 protected void engineInit( 35 int strength, 36 SecureRandom random) 37 { 38 this.strength = strength; 39 this.random = random; 40 } 41} 42