[英]keep corporate app alive in background
I am developing a corporate app that will be publish on an internal store. 我正在开发将在内部商店发布的企业应用程序。 The app is just supposed to keep in memory some credentials but I can't store them on the device for security reasons.
该应用程序仅应在内存中保留一些凭据,但出于安全原因,我无法将其存储在设备上。
I want the app to stay in background as long as possible but I don't know what is the best solution knowing that I won't have to publish the app in the AppStore. 我希望该应用程序尽可能长时间地处于后台运行,但是我知道不必在AppStore中发布该应用程序,因此我不知道什么是最佳解决方案。
I read about the option in plist Required background modes
, but I don't know which option is the most efficient for my situation. 我在plist
Required background modes
阅读了有关该选项的信息,但我不知道哪个选项对我的情况最有效。
Firstly , you don't need to keep running app in background, second you can store "those [secret] credentials" in keychain
store with some encrypted format, SHA1
or MD5
or any other cryptographic hash functions can be use for this, third the benefit of this is you can access to them from your different apps as well (by using the same encryption key to decryption and accessing keychain
store item), at last when you no longer need it, you can even delete it. 首先 ,您无需在后台运行应用程序; 其次,您可以使用一些加密格式将“那些[秘密]凭证”存储在
keychain
存储中, SHA1
或MD5
或任何其他加密哈希函数都可以用于此目的, 第三是这样做的好处是,您也可以从不同的应用程序访问它们(通过使用相同的加密密钥进行解密并访问keychain
存储项), 最后,当不再需要它时,甚至可以将其删除。 The only thing you need to keep secret is keychain
store key (which you used to store credentials) and also your encryption key (to used with cryptographic hash function). 您唯一需要保密的是
keychain
存储密钥(用于存储凭据)以及加密密钥(与加密哈希功能一起使用)。
There's are several libraries available to easily manipulate data in keychain
store, here's the one, and here's the solution to apply MD5 or SHA1 . 有几个库可用来轻松操纵
keychain
存储中的数据, 这是一个库, 这是 应用MD5或SHA1的解决方案 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.