RxReader / alipay_kit

Flutter版支付宝登录/支付
MIT License
313 stars 60 forks source link

关于支付宝商户密钥长度的问题 #7

Closed lantongxue closed 4 years ago

lantongxue commented 4 years ago

作者您好: 目前使用您的SDK发现一个问题,您的SDK在调用支付时,验证了商户私钥的长度不能低于2048位,但是目前使用支付宝官方的密钥生成工具生成出来的密钥只有1000多位,即便在生成时选择了密钥长度为2048位。

请问这个问题怎么解决呢?

droplet-js commented 4 years ago

rsa1长度1024,rsa2长度2048

lantongxue commented 4 years ago

rsa1长度1024,rsa2长度2048

但是工具生成出来的密钥没有2048位啊。

droplet-js commented 4 years ago

pkcs1/pkcs8 - 2048 https://docs.open.alipay.com/291/105971/

droplet-js commented 4 years ago

或者实在不会,signType 填 rsa1,rsa2才需要2048长度密钥

lantongxue commented 4 years ago

我的确是按照文档生产的密钥,但密钥实际的字符串个数没有2048个。。。

lantongxue commented 4 years ago

您好,我在使用中发现了一个新问题

I/flutter (15558): 支付宝已经安装,发起支付...
W/System.err(15558): java.lang.SecurityException: getDeviceId
W/System.err(15558):    at android.os.Parcel.createException(Parcel.java:1953)
W/System.err(15558):    at android.os.Parcel.readException(Parcel.java:1921)
W/System.err(15558):    at android.os.Parcel.readException(Parcel.java:1871)
W/System.err(15558):    at com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceId(ITelephony.java:5398)
W/System.err(15558):    at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:1240)
W/System.err(15558):    at com.alipay.sdk.util.a.<init>(SourceFile:38)
W/System.err(15558):    at com.alipay.sdk.util.a.a(SourceFile:27)
W/System.err(15558):    at com.alipay.sdk.tid.b.a(SourceFile:79)
W/System.err(15558):    at com.alipay.sdk.app.statistic.c.<init>(SourceFile:1229)
W/System.err(15558):    at com.alipay.sdk.app.statistic.a.a(SourceFile:21)
W/System.err(15558):    at com.alipay.sdk.app.PayTask.<init>(SourceFile:58)
W/System.err(15558):    at io.github.v7lin.fakealipay.FakeAlipayPlugin$1.run(FakeAlipayPlugin.java:66)
W/System.err(15558):    at java.lang.Thread.run(Thread.java:764)
droplet-js commented 4 years ago

这是获取设备ID的一个警告,不必理会

lantongxue commented 4 years ago

好的。

droplet-js commented 4 years ago

密钥长度问题,我后续会将长度限制去掉

lantongxue commented 4 years ago

密钥长度问题,我后续会将长度限制去掉

感谢您的更新支持