title: PBE AlgorithmParameters not available
body: <p>I have a problem i try to authenticate with google api using ouath2 with generated .p12 key.</p>
  
  <p>The issuse is that when the google credential api tries to set .p12 key it throws 
  java.io.IOException: parseAlgParameters failed: PBE AlgorithmParameters not available.</p>
  
  <p>My machine run Windows 10 Home 64bit creators update and i have jdk 1.6 installed. 
  I tried launching project from netbeans and intellij idea the issuse is the same on both. My co-workers launch project from linux and everything works. I also tried to set jce policies to unlimited.</p>
  
  <p>Here is a stack trace dump </p>
  
  <pre><code>   Error during init Google Play API
  java.io.IOException: parseAlgParameters failed: PBE AlgorithmParameters not available
      at com.sun.net.ssl.internal.pkcs12.PKCS12KeyStore.parseAlgParameters(PKCS12KeyStore.java:527)
      at com.sun.net.ssl.internal.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1267)
      at java.security.KeyStore.load(KeyStore.java:1185)
      at com.google.api.client.util.SecurityUtils.loadKeyStore(SecurityUtils.java:77)
      at com.google.api.client.util.SecurityUtils.loadPrivateKeyFromKeyStore(SecurityUtils.java:110)
      at com.google.api.client.googleapis.auth.oauth2.GoogleCredential$Builder.setServiceAccountPrivateKeyFromP12File(GoogleCredential.java:670)
      at com.iapps.pdf_platform.payment.AndroidPublisherHelper.authorizeWithServiceAccount(AndroidPublisherHelper.java:70)
      at com.iapps.pdf_platform.payment.AndroidPublisherHelper.init(AndroidPublisherHelper.java:91)
      at com.iapps.pdf_platform.payment.GooglePlayPaymentVerification.checkGooglePurchase(GooglePlayPaymentVerification.java:110)
      at com.iapps.pdf_platform.payment.GooglePlayPaymentVerification.veriifyForService(GooglePlayPaymentVerification.java:96)
      at com.iapps.pdf_platform.service.GooglePlayPaymentVerificationService.verifyPurchase(GooglePlayPaymentVerificationService.java:102)
      at com.iapps.pdf_platform.service.GooglePlayPaymentVerificationService.verfifyGooglePlayPayments(GooglePlayPaymentVerificationService.java:71)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1056)
      at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1128)
      at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5292)
      at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
      at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
      at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
      at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
      at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:139)
      at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
      at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
      at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
      at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5264)
      at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5252)
      at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
      at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
      at com.sun.proxy.$Proxy311.verfifyGooglePlayPayments(Unknown Source)
      at com.iapps.pdf_platform.service.__EJB31_Generated__GooglePlayPaymentVerificationService__Intf____Bean__.verfifyGooglePlayPayments(Unknown Source)
      at com.iapps.pdf_platform.servlet.Tests.doGet(Tests.java:53)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
      at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
      at java.lang.Thread.run(Thread.java:662)
  Caused by: java.security.NoSuchAlgorithmException: PBE AlgorithmParameters not available
      at sun.security.jca.GetInstance.getInstance(GetInstance.java:142)
      at java.security.Security.getImpl(Security.java:659)
      at java.security.AlgorithmParameters.getInstance(AlgorithmParameters.java:113)
      at com.sun.net.ssl.internal.pkcs12.PKCS12KeyStore.parseAlgParameters(PKCS12KeyStore.java:523)
      ... 62 more
  </code></pre>
  
  <p>The .p12 key is using BC provider </p>
  
  <pre><code>    Keystore type: PKCS12
  Keystore provider: BC
  
  Your keystore contains 1 entry
  
  privatekey, 2017-07-10, PrivateKeyEntry,
  </code></pre>