Skip to main content

DeviceSecureStorage

Namespace: Wisej.Hybrid

Assembly: Wisej.Hybrid (4.1.0.0)

Provides secure storage functionality for sensitive information on the device. This class allows for the storing, retrieving, and deleting of secure information.

public class DeviceSecureStorage

This class requires special setup. Access this class through the Device singleton. See: https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/storage/secure-storage for details.

Methods​

Instance member Get(key)​

Retrieves the securely stored value associated with the given key.

ParameterTypeDescription
keyStringThe key for the desired value.

Returns: String. The value associated with the specified key if it exists; otherwise, null.

Instance member GetAsync(key)​

Retrieves the securely stored value associated with the given key.

ParameterTypeDescription
keyStringThe key for the desired value.

Returns: Task<String>. The value associated with the specified key if it exists; otherwise, null.

Instance member Remove(key)​

Removes the securely stored value associated with the given key.

ParameterTypeDescription
keyStringThe key whose value should be removed.

Returns: Boolean. true if the value was successfully removed; otherwise, false.

Instance member RemoveAll()​

Removes all values stored in secure storage.

Returns: Boolean. true if all values were successfully removed.

Instance member RemoveAllAsync()​

Removes all values stored in secure storage.

Returns: Task<Boolean>. true if all values were successfully removed.

Instance member RemoveAsync(key)​

Removes the securely stored value associated with the given key.

ParameterTypeDescription
keyStringThe key whose value should be removed.

Returns: Task<Boolean>. true if the value was successfully removed; otherwise, false.

Instance member Set(key, value)​

Stores a value securely under the given key.

ParameterTypeDescription
keyStringThe key under which to store the value.
valueStringThe value to be stored.

Returns: Boolean. true if the value was successfully set.

Instance member SetAsync(key, value)​

Stores a value securely under the given key.

ParameterTypeDescription
keyStringThe key under which to store the value.
valueStringThe value to be stored.

Returns: Task<Boolean>. true if the value was successfully set.