本文介绍了OkHttp PublicKey固定在Android上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道我们如何使用OkHttp3实现公钥固定

Does anyone know how we could implement Public Key pinning with OkHttp3

一直在阅读有关SSL固定的信息,我发现我们可以使用证书固定或公共密钥固定(后者似乎更灵活)来做到这一点.但是我只能找到使用OkHttp和证书固定的示例没有按键固定.

Have been reading about SSL pinning and I see that we could do it with either Certificate Pinning or Public Key pinning (the latter seems more flexible). But I was only able to find example of Certificate pinning with OkHttp and none of Key Pinning.

有人知道使用OkHttp实现这有多么容易(和/或如何执行此操作的示例)吗?

Does anyone know how easy this is to implement with OkHttp (and/or an example of how to go about doing so)?

TIA

推荐答案

请仔细阅读 CertificatePinner ,并且似乎该实现实际上是一个公共密钥检查,因此实际上是一个公共密钥固定的实现(因此将其添加为一个答案).

Been looking through the source of the CertificatePinner in OkHttp3 and it seems that the implementation is actually a Public Key check so is in fact an implementation of Public Key Pinning (hence adding this as an answer).

如果我错了,请纠正我?

Please correct me if I'm wrong?

这篇关于OkHttp PublicKey固定在Android上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 11:28