January 2017
Beginner to intermediate
1045 pages
22h 24m
English
Internal storage is yet another way of storing data in Android Apps, usually in the file directory under /data/data/<app name>.
The following code shows how the internal storage is used to store the private key of an application, which it is used to store and send credit card and SSN numbers of a user:
String publicKeyFilename = "public.key";
String privateKeyFilename = "private.key";
try{
GenerateRSAKeys generateRSAKeys = new GenerateRSAKeys();
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
// Generate public & private keys
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA", "BC"); //create base64 handler BASE64Encoder b64 = new BASE64Encoder(); //Create random number SecureRandom ...