如何保护本地原生ios中的fabric_api密钥?

时间:2019-01-16 06:22:12

标签: ios react-native crashlytics google-fabric info.plist

我已将fabric_api密钥存储在Info.plist文件中。但是,当应用程序启动时,我不想在info.plist文件中包含密钥和机密。

确保Fabric / Crashlytics密钥安全的最佳方法是什么?

1 个答案:

答案 0 :(得分:0)

我只知道几种方法:

  1. 只需将其放在常量变量中,或者如果您想在处理所有键的结构下使用它。而已。
  2. UserDefaults。
  3. 使用库以某种方式混淆您的密钥,例如https://github.com/orta/cocoapods-keys
  4. 钥匙扣。

最后一个由苹果公司讨论。

  

在钥匙串中保留私钥是保护它的一种好方法。密钥数据已在磁盘上加密,并且只能由您的应用或您授权的应用访问。

https://developer.apple.com/documentation/security/certificate_key_and_trust_services/keys/storing_keys_in_the_secure_enclave

还有一些有趣的讨论:

  1. In iOS, how can I store a secret "key" that will allow me to communicate with my server?

  2. swift3 - How to protect secret key

我希望这会有所帮助。