gpt4 book ai didi

java - PBE 算法参数不可用

转载 作者:太空宇宙 更新时间:2023-11-04 11:20:10 25 4
gpt4 key购买 nike

我尝试使用 ouath2 和生成的 .p12 key 通过 google api 进行身份验证时遇到问题。

问题是,当 google credential api 尝试设置 .p12 key 时,它会抛出异常java.io.IOException:parseAlgParameters失败:PBE AlgorithmParameters不可用。

我的机器运行 Windows 10 Home 64bit 创建者更新,并且安装了 jdk 1.6。我尝试从 netbeans 和 intellij idea 启动项目,两者的问题是相同的。我的同事从 Linux 启动项目,一切正常。我还尝试将 jce 策略设置为无限制。

这是堆栈跟踪转储

   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

.p12 key 正在使用 BC 提供商

    Keystore type: PKCS12
Keystore provider: BC

Your keystore contains 1 entry

privatekey, 2017-07-10, PrivateKeyEntry,

最佳答案

我将 Bouncy CaSTLe Provider 添加到 java.security 文件中,并将 Bouncy CaSTLe jar 添加到 jdk 中。一切都按预期进行。 jvm 根本没有用于解密 key 的算法的提供者。

关于java - PBE 算法参数不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45009226/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com