Code example for RSAPrivateKeySpec

0
		} 
	} 
	 
	public void initRSA(BigInteger modulus, BigInteger privateKey) {
		try { 
			RSAPrivateKeySpec rsaspec = new RSAPrivateKeySpec(modulus, privateKey);
			PrivateKey pub = factory.generatePrivate(rsaspec);
			cipher.init(Cipher.DECRYPT_MODE, pub);
		} catch (Exception e) {
			e.printStackTrace();
		} 
	} 
 
	public byte[] encode(byte[] data) {
		try { 
			return cipher.doFinal(data);
		} catch (Exception e) {
			e.printStackTrace();
		} 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE