Hello I generated a pair of keys with the following code
KeyPairGenerator generator = KeyPairGenerator.getInstance(RSA);
generator.initialize(1024);
KeyPair pair = generator.generateKeyPair();
privateKey= pair.getPrivate();
publicKey= pair.getPublic();
I wanted to save this keys in the cloud for later using them in an android App. So I use this code to save them as an String
String privateKey = Base64.getEncoder().encodeToString(this.privateKey.getEncoded());
The problem is that I need to generate this keys again in the android app (not use them as an string) and save them into the KeyStore from android for saving them in the app secure.
Here is the documentation of the KeyStore and Keygenerator: https://developer.android.com/training/articles/keystore