i have this code :
// Turn the encoded key into a real RSA public key.
// Public keys are encoded in X.509.
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
PublicKey publicKey = keyFactory.generatePublic(keySpec);
error:
java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: IOException: Detect premature EOF
where is the problem?