I have a bse64encoded string Public key from external source (Android Store) and I need to use it to verify signed content. How can I convert the string into an instance of
Try this....
PublicKey getPublicKey(byte[] encodedKey) throws NoSuchAlgorithmException, InvalidKeySpecException { KeyFactory factory = KeyFactory.getInstance("RSA"); X509EncodedKeySpec encodedKeySpec = new X509EncodedKeySpec(encodedKey); return factory.generatePublic(encodedKeySpec); }