![](/img/trans.png)
[英]Android Studio KotLin Insert/Update/Delete in Postgresql
[英]How to delete an Encrypted File in Kotlin/ Android Studio
我正在使用 Kotlin 創建並寫入應用程序本地存儲的加密文件以臨時存儲登錄憑據,注銷時,我想刪除此文件。
要創建文件,我使用如下 EncryptedFile.Builder 方法;
val encryptedFileName = "UserAuthData_.txt"
val mainKey = MasterKey.Builder(applicationContext)
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
.build()
val encryptedFile = EncryptedFile.Builder(
applicationContext,
File(applicationContext.applicationInfo.dataDir, encryptedFileName),
mainKey,
EncryptedFile.FileEncryptionScheme.AES256_GCM_HKDF_4KB
).build()
我想刪除此文件,但找不到任何這樣做的方法。
任何想法將不勝感激。
謝謝!
您可以使用它簡單地刪除文件 -
File someFile = new File(encryptedFileName);
someFile.delete();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.