Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte[] decodedPrivateKey = Base64.decode(savedText1,0);
- PKCS8EncodedKeySpec X509privbKey = new PKCS8EncodedKeySpec(decodedPrivateKey);
- privKey = KeyFactory.getInstance("RSA").generatePrivate(X509privbKey);
- editText.setText(privKey.toString());
- //byte[] bytes2 = cipher2.doFinal(txt.getBytes("UTF-8"));
- byte [] decodedMess = Base64.decode(productObject.getString("data"), 0);
- Cipher decript2 = Cipher.getInstance("RSA");
- decript2.init(Cipher.DECRYPT_MODE,privKey);
- byte[] decriptedBytes2 = decript2.doFinal(decodedMess);
- String s =new String(decriptedBytes2, "UTF-8");
- Toast toast = Toast.makeText(getApplicationContext(), s.toString(), Toast.LENGTH_SHORT);
- toast.show();
Add Comment
Please, Sign In to add comment