title: java.security.InvalidAlgorithmParameterException: GCM can not be used with class javax.crypto.spec.GCMParameterSpec
body: <p>I'm Encrypting the data with "AES/GCM/NoPadding" algorithm, before cipher init method I'm getting <strong>java.security.InvalidAlgorithmParameterException: GCM can not be used with class javax.crypto.spec.GCMParameterSpec</strong> error, is there any specific reason for this??</p>
  
  <pre><code>Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
  GCMParameterSpec parameterSpec = new GCMParameterSpec(128, iv);
  SecretKeySpec keySpec = new SecretKeySpec(key, "AES");
  cipher.init(Cipher.ENCRYPT_MODE, keySpec, parameterSpec);
  </code></pre>