Code example for RSAKeyGenParameterSpec

0
 
import javax.crypto.Cipher; 
 
public class RSACryptoCipher extends CryptoCipher { 
 
	public static final AlgorithmParameterSpec parameterSpec = new RSAKeyGenParameterSpec(1024, RSAKeyGenParameterSpec.F4);
	private KeyFactory factory;
 
	public RSACryptoCipher(String algoName, AlgorithmParameterSpec spec) {
		super(algoName, spec);
 
		try { 
			factory = KeyFactory.getInstance(algorithmName);
		} catch (Exception e) {
			e.printStackTrace();
		} 
	} 
 
	public void init(byte[] keyData) {
		try {