简体   繁体   English

私人钥匙串商店

[英]Private Keychain store

We have an enterprise iOS SDK that uses Keychain to store highly sensitive information.我们有一个企业iOS SDK,它使用Keychain来存储高度敏感的信息。 These information are not available to the client's app.这些信息对客户端的应用程序不可用。

I've always thought that you need a key to fetch the associated value from the Keychain.我一直认为您需要一个密钥来从钥匙串中获取关联的值。 But recently, I found out you can ask Keychain to return all the stored keys in Keychain (IMHO, this is a bad design).但是最近,我发现您可以要求 Keychain 返回 Keychain 中存储的所有密钥(恕我直言,这是一个糟糕的设计)。

Since the client's app can easily fetch all the Keychain elements, I'd really like to create a separate Keychain store for the SDK only.由于客户端的应用程序可以轻松获取所有钥匙串元素,我真的很想为 SDK 创建一个单独的钥匙串商店。 I've looked over SO questions but never found an answer.我已经查看了 SO 问题,但从未找到答案。

TL;DR: How to create a separate Keychain store in iOS? TL;DR:如何在 iOS 中创建单独的钥匙串存储?

You can't.你不能。

The security boundary for the KeyChain is the app (Or the KeyChain identifier across multiple apps from the same developer if you enable KeyChain sharing). KeyChain 的安全边界是应用程序(如果您启用 KeyChain 共享,则为来自同一开发人员的多个应用程序的 KeyChain 标识符)。

Once your framework is embedded in the client app, it is part of the client app.一旦您的框架嵌入到客户端应用程序中,它就是客户端应用程序的一部分。 It doesn't have its own context or process space or anything to distinguish its code from the client code.它没有自己的上下文或进程空间或任何将其代码与客户端代码区分开来的东西。

If code in your framework puts something in the KeyChain then, to iOS, it is the client app that has put something in the KeyChain, and there is no reason to keep a secret from itself.如果您的框架中的代码在 KeyChain 中放置了一些东西,那么对于 iOS,它是客户端应用程序在 KeyChain 中放置了一些东西,并且没有理由对其自身保密。

Even if you could create a KeyChain just for your framework, presumably the code that puts the information in the KeyChain is in your framework, so an attacker could just decompile your framework to obtain the information.即使您可以仅为您的框架创建一个 KeyChain,也可能将信息放入 KeyChain 的代码在您的框架中,因此攻击者可以通过反编译您的框架来获取信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM