Advertisement
Guest User

CNSecureStorage IOS

a guest
Feb 26th, 2025
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1.     public partial class CNSecureStorage : ICNSecureStorage
  2.     {
  3.         //TODO: Replace this with an actually secure implementation. This is just to unblock us.
  4.         public Task<string?> GetAsync(string key) => Task.FromResult(Preferences.Default.Get<string?>(key, null, "iOSSecureStorage"));
  5.  
  6.         public bool Remove(string key)
  7.         {
  8.             Preferences.Default.Remove(key, "iOSSecureStorage");
  9.             return true;
  10.         }
  11.  
  12.         public void RemoveAll() => Preferences.Default.Clear("iOSSecureStorage");
  13.  
  14.         public Task SetAsync(string key, string value) => Task.Run(() => Preferences.Default.Set(key, value, "iOSSecureStorage"));
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement