Reputation: 17828
To better protect Realm, I would like to roll the security tokens every now and then.
I followed the guide on how to encrypt, but did not find anywhere how I can change the key to a new one.
Anyone know what might be the best way to achieve this goal?
Upvotes: 0
Views: 667
Reputation: 1447
There is no way to change an encryption key for an existing Realm. Instead you would need to create a second Realm and copy all objects from the old Realm - you can do this by looping through all object and passing them into newRealm.create
. You could then call realm.close()
on each realm and copy the file to the path of the original Realm.
Upvotes: 1