title: android invalid key specification exception?
body: <p>i am using InApp Purchase api in my application ,where i have made an demo project ,in which i have taken one button,when we click on button i am getting this screen here
  <img src="https://i.stack.imgur.com/kovd3.png" alt="here"></p>
  
  <p>after then when i click on buy button an dialog shows that "payement sucessful",the image is here<img src="https://i.stack.imgur.com/kxpS8.png" alt="enter image description here"></p>
  
  <p>after showing this dialog,my application get forceclosed.,i am getting error at this line</p>
  
  <pre><code>public static PublicKey generatePublicKey(String encodedPublicKey) {
      try {
          byte[] decodedKey = Base64.decode(encodedPublicKey);
          KeyFactory keyFactory = KeyFactory.getInstance(KEY_FACTORY_ALGORITHM);
          return keyFactory.generatePublic(new X509EncodedKeySpec(decodedKey));
      } catch (NoSuchAlgorithmException e) {
          throw new RuntimeException(e);
      } catch (InvalidKeySpecException e) {
          Log.e(TAG, "Invalid key specification.");
          throw new IllegalArgumentException(e);
      } catch (Base64DecoderException e) {
          Log.e(TAG, "Base64DecoderException.", e);
          return null;
      }
  }
  </code></pre>
  
  <p>here is my logcat
  <img src="https://i.stack.imgur.com/iHtKa.png" alt="enter image description here"></p>