> For the complete documentation index, see [llms.txt](https://docs.wisej.com/hybrid/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/hybrid/start/api/storage/wisej.hybrid.devicesecurestorage.md).

# DeviceSecureStorage

Namespace: **Wisej.Hybrid**

Assembly: **Wisej.Hybrid** (3.5.0.0)

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

{% tabs %}
{% tab title="C#" %}

```csharp
public class DeviceSecureStorage
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class DeviceSecureStorage
```

{% endtab %}
{% endtabs %}

This class requires special setup. Access this class through the [Device](/hybrid/start/api/general/wisej.hybrid.device.md) singleton. See: <https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/storage/secure-storage> for details.

## Constructors

### ![](/files/CCV9PPenlC1YZvNh1I6R)DeviceSecureStorage()

Initializes a new instance of [DeviceSecureStorage](/hybrid/start/api/storage/wisej.hybrid.devicesecurestorage.md).

## Methods

### ![](/files/CCV9PPenlC1YZvNh1I6R)Get(key)

Retrieves the securely stored value associated with the given key.

| Parameter | Type                                                          | Description                    |
| --------- | ------------------------------------------------------------- | ------------------------------ |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The key for the desired value. |

**Returns:** [String](https://docs.microsoft.com/dotnet/api/system.string). The value associated with the specified key if it exists; otherwise, null.

### ![](/files/CCV9PPenlC1YZvNh1I6R)Remove(key)

Removes the securely stored value associated with the given key.

| Parameter | Type                                                          | Description                            |
| --------- | ------------------------------------------------------------- | -------------------------------------- |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The key whose value should be removed. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if the value was successfully removed; otherwise, false.

### ![](/files/CCV9PPenlC1YZvNh1I6R)RemoveAll()

Removes all values stored in secure storage.

### ![](/files/CCV9PPenlC1YZvNh1I6R)Set(key, value)

Stores a value securely under the given key.

| Parameter | Type                                                          | Description                             |
| --------- | ------------------------------------------------------------- | --------------------------------------- |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The key under which to store the value. |
| **value** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The value to be stored.                 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/hybrid/start/api/storage/wisej.hybrid.devicesecurestorage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
