Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

敏感信息加密 #14

Closed
saturdaysunny opened this issue May 17, 2020 · 5 comments · Fixed by #15
Closed

敏感信息加密 #14

saturdaysunny opened this issue May 17, 2020 · 5 comments · Fixed by #15
Assignees
Labels
enhancement New feature or request

Comments

@saturdaysunny
Copy link

”开发者应当使用微信支付平台证书中的公钥,对上送的敏感信息进行加密。“
我采用AutoUpdateCertificatesVerifier自动更新证书,我需要拿到证书才能进行加密,但是AutoUpdateCertificatesVerifier中的verifier字段是private的,CertificatesVerifier中的private final HashMap<BigInteger, X509Certificate> certificates 也是私有的。目前我是采用反射的方式获取平台证书的。

@xy-peng
Copy link
Contributor

xy-peng commented May 18, 2020

是希望有方法可以取到证书?

@saturdaysunny
Copy link
Author

是的,希望AutoUpdateCertificatesVerifier提供方法获取证书,用于加密敏感信息

@xy-peng xy-peng self-assigned this May 18, 2020
@xy-peng xy-peng added the enhancement New feature or request label May 18, 2020
@fuzhoudong
Copy link

同求啊,痛点。。。。

@saturdaysunny
Copy link
Author

"某些情况下,微信支付会更新平台证书。这时,商户有多个微信支付平台证书可以用于加密。为了保证解密顺利,商户发起请求的HTTP头部中应包括证书序列号,以声明加密所用的密钥对和证书。
商户上送敏感信息时使用微信支付平台公钥加密,证书序列号包含在请求HTTP头部的Wechatpay-Serial"。
目前verifier.getValidCertificate();只返回了证书,没有返回证书序列号,敏感信息加密的数据提交的时候需要带上请求头Wechatpay-Serial,作者应该把证书序列号也一起返回出来

@saturdaysunny saturdaysunny changed the title 普通服务商-特约商户进件-提交申请单-敏感信息加密 敏感信息加密 Jun 15, 2020
@xy-peng
Copy link
Contributor

xy-peng commented Jun 15, 2020

证书直接用getSerialNumber方法就可以拿到证书序列号,不过是BigInterger,还要再转一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants