According to the MAUI docs, the key used to encrypt data when using Microsoft.Maui.Storage.ISecureStorage
may change:
It's possible that an exception is thrown when calling
GetAsync
orSetAsync
. This can be caused by a device not supporting secure storage, encryption keys changing, or corruption of data.
However, I haven't been able to determine when or how the encryption keys might change. The MAUI docs themselves don't seem to address the subject, so I'm not sure if this is an undocumented feature of MAUI, or whether the answer is platform-dependent.
Context: I'm developing a MAUI application that will allow a user to integrate with third-party services using API keys. Since these are sensitive, I would like to put them in secure storage instead of the app's SQLite database - but if the encryption keys are liable to change, I don't want to develop the app in such a way that users are forced to re-enter their API credentials regularly. I'm trying to determine when or how encryption keys might change so I can decide whether ISecureStorage
is a good fit for my use case.