I have a webservice in java using Spring that needs to generate a RSA Key Pair and send the PUBLIC KEY via this WS, so that a ANDROID and a iOS app can read and encrypt a STRING using this public key.
On every WS request, it must to generate a new Key Pair.
I've try to use the KeyPair class in Java an only the ANDROID app has recognized the public key.
How can I do that? Can someone help me with this?