android - 应用程序开发 : Create Certificate in app itself

标签 android ios security ssl-certificate

我的客户在胖客户端中创建证书,因此他最终使用的是服务器证书和应用程序安装后创建的个人客户端证书。现在客户端和服务器都验证彼此的证书。

有人问我这种方法是否适用于 iOS 和 Android 应用程序。我在网上找到的所有内容都是服务器始终创建证书并且公钥随应用程序一起部署。

对此有什么建议吗?它会提供额外的安全层吗?

最佳答案

简单的答案是肯定的,您可以在应用程序中创建一个 key - 在 Java 领域有几个库可以做到这一点,例如,大多数库都是基于 Java JCE Api 标准构建的:

关于如何使用库和提供程序有多种选择,还有独立的加密库,最著名的是 BouncyCaSTLe,它是 Android 的衍生品 SpobgyCaSTLe:

这里有一个略显陈旧但非常好的答案,它在 Android 上提供了良好的背景:https://stackoverflow.com/a/9965964/334402

上面的 Java Cryptography 文档中有一个很好的说明,还有:

WARNING: The JCA makes it easy to incorporate security features into your application. However, this document does not cover the theory of security/cryptography beyond an elementary introduction to concepts necessary to discuss the APIs. This document also does not cover the strengths/weaknesses of specific algorithms, not does it cover protocol design. Cryptography is an advanced topic and one should consult a solid, preferably recent, reference in order to make best use of these tools.

You should always understand what you are doing and why: DO NOT simply copy random code and expect it to fully solve your usage scenario. Many applications have been deployed that contain significant security or performance problems because the wrong tool or algorithm was selected.

您会发现许多密码学文本中也反射(reflect)了这一点 - 本质上它是说您的安全性仅与最薄弱的环节一样强大,并且存在将密码学添加到应用程序并认为一切都很好的危险。

最薄弱环节的一个易于理解的示例是,如果您生成了一个非常强大的私钥/公钥对,但私钥本身的安全性较弱,允许黑客调试您的应用程序来发现它。

关于android - 应用程序开发 : Create Certificate in app itself,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42068560/

相关文章:

ios - 如何顶部对齐 UITableView 单元格中的文本?

security - 不安全使用用户提供的 GString :s in Groovy/Grails

MySQL - 在存储的函数/过程参数列表中使用 "` "字符的区别

android - 替换括号内的字符

android - 如何使网页上的比特币支付按钮启动android钱包应用程序

ios - 获取 UITableview 部分中的最后一个单元格

c# - 用于页面访问控制的 PrincipalPermission 与 web.config

java - 日期和 GregorianCalendar 毫秒处理

android - 在 Android 中自动在 editText 中添加破折号

ios - 通过 native iOS联系人应用获取钛的联系方式