I have tried the same using java but the resulting byte array is not correct:
public void publicKeyConvert{
final String PUBLIC_KEY_STRING="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxl4aRnRMBB9GZk";
try{
System.out.println("Public Key in byte[] :"+ Arrays.toString(Base64.decode(PUBLIC_KEY_STRING, Base64.DEFAULT)));
} catch (Exception ex) {
Log.e("Error converting key", ex.getMessage());
}
Rather than converting the string as I tried in my example I am looking for a solution where I can input the public key file (.pem format) and receive the byte array as output preferably using OpenSSL.