byte[] raw = RSAUtil.encrypt(priKey, orgData); file = new File("encrypt_result.dat"); OutputStream out = new FileOutputStream(file); out.write(raw); out.close(); byte[] data = RSAUtil.decrypt(recoveryPubKey, raw); file = new File("decrypt_result.html"); out = new FileOutputStream(file); out.write(data); out.flush(); out.close(); } }