Closed timshadel closed 1 year ago
Since it is up to the developer to setup the codec, it is hard to decide when to clean it up so we could let the developer cleaning up the codec when calling close (most application never closes the database, what if the codec is used on 2 databases...).
If a new codec api is added - let say to support asynchronous encryption ;) - we could consider adding a onClose
so that the codec can cleanup whatever it needs. But even though, I'd rather let the developer controlling that.
An important security measure for production-grade encryption requires zeroing out the memory of sensitive information like encryption keys. When
Database.close()
is called, it should calldispose()
orclose()
on the encryption codec to allow for this safe cleanup.