You can use this to transform your String (encoded in Base64) in a PublicKey instance :
Note : I don't know how you encode your String in Base64, if you used the apache commons for example, use the "revert" method from the same API. For this example I used sun.misc.BASE64Decoder because the String publicKey is encoded with sun.misc.BASE64Encoder.
/**
* Verify the origin of the message using signature and encoded message.
* @param publicKey String - a public key, created with RSA and encoded with sun.misc.BASE64Encoder.
* @param sign String - a signature encoded with sun.misc.BASE64Encoder.
* @param message String - an encoded message.
* @return
* @throws NoSuchAlgorithmException
* @throws NoSuchPaddingException
* @throws InvalidKeySpecException
* @throws InvalidKeyException
* @throws InvalidAlgorithmParameterException
* @throws IllegalBlockSizeException
* @throws BadPaddingException
* @throws NoSuchProviderException
* @throws IOException
* @throws SignatureException
* @see sun.misc.BASE64Encoder
*/
public boolean verifyMessageSign(String publicKey, String sign, String message) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeySpecException, InvalidKeyException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException, NoSuchProviderException, IOException, SignatureException{
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
//Create the PublicKey object from the String encoded in Base64.
X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(new BASE64Decoder().decodeBuffer(publicKey));
PublicKey pub = keyFactory.generatePublic(publicKeySpec);
Signature sig = Signature.getInstance("SHA1withRSA");
sig.initVerify(pub);
sig.update(message.getBytes());
return sig.verify(new BASE64Decoder().decodeBuffer(sign));
}