mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
how to encrypted sql file by use corestore #120
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yaochenfeng on GitHub (Jan 18, 2017).
how to encrypted sql file by use corestore
@JohnEstropia commented on GitHub (Jan 19, 2017):
There is no built-in way to do this right now. Are you talking about Core Data's
NSPersistentStoreFileProtectionKeyoption?In the meantime, you can duplicate the code for
SQLiteStoreand implement your ownLocalStoragethat addsNSPersistentStoreFileProtectionKeyoption to the options dictionary:Note that this just uses iOS's Data Protection API and the file is only encrypted when the user's device is passcode-locked.
Otherwise, if you are looking for a way to fully encrypt the database you would need to look for a separate framework, wrap it in an
NSIncrementalStoreimplementation (I found a very old library here), and then implement CoreStore'sLocalStorageprotocol. Needless to say, this seems like a lot of work.