--- title: "Available methods in the Secure Storage SDK" slug: "secure-storage-sdk-ig-available-methods-5-8-0" updated: 2026-08-27T10:07:39Z published: 2026-08-27T10:07:39Z canonical: "docs.onespan.com/secure-storage-sdk-ig-available-methods-5-8-0" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.onespan.com/llms.txt > Use this file to discover all available pages before exploring further. # Available methods in the Secure Storage SDK ## Method to initialize a secure storage The init method creates a volatile storage instance and initializes it with a secure storage. If the given storage name already exists, the init method reads the content of the permanent storage and places it in the volatile storage instance. Each data contained in the storage is identified by a unique key. The storage can contain either a string or a data. > A mobile application can create several storages and gives each storage a different file name. Each storage is private for the mobile application that created it; Therefore, storages cannot be shared between several applications. ### Android-specific considerations Beginning with the Secure Storage SDK version 5.0.0, you should use the SecureStorage.createSecureStorage API instead of the deprecated init static method to initialize a secure storage. On Android, the SDK initializes **asynchronously**. > The SDK instance must not be accessed or used until it has been returned via the initialization callback. Any attempt to use the instance before this point may result in a null pointer exception, unexpected termination, or data loss based on the implementation in your code. For a complete example of the initialization pattern, refer to the sample app included in the product package. ### iOS-specific considerations On iOS, the SDK initializes synchronously but the storage should be loaded into memory after initialization and before use. The loading operation is asynchronous. ## Methods to manage the volatile storage [Volatile Storage Management](/mobile/docs/secure-storage-sdk-ig-available-methods-5-8-0#Tab_Volatile_Storage_Management) lists the available methods to read, add, or remove data from the volatile storage. | Volatile Storage Management | | --- | | Method | Description | | Check in storage | Check if the volatile storage contains a key. | | Clear storage | Clear the volatile storage. | | Get all data from storage | Retrieve all data from the volatile storage. | | Get data from storage | Retrieve data from the volatile storage. | | Get storage size | Get the number of saved items in the volatile storage, returned as: - count on iOS - size on Android | | Put data into storage | Add data to the volatile storage. | | Remove data from storage | Delete data from the volatile storage. | ## Methods to manage the permanent storage [Permanent Storage Management](/mobile/docs/secure-storage-sdk-ig-available-methods-5-8-0#Tab_Permanent_Storage_Management) lists the available methods to manage the permanent storage. | Permanent Storage Management | | --- | | Method | Description | | Write storage | Write data to be stored from the volatile storage to the permanent storage. | | Delete storage | Delete the permanent storage. As of version 5.5.0 of the SDK, to simplify usage in synchronous contexts, this method is no longer asynchronous and the method signature does not require the `await` keyword when being called. | > The UNREADABLE_STORAGE and STORAGE_CORRUPTED exceptions on Android or the unreadableStorage and storageCorrupted errors on iOS are non-recoverable exceptions that could have been caused by events outside of the scope of the SDK (like missing a decryption key after a backup/restore of the device). When you catch these exceptions and errors, use the methods in [Volatile Storage Management](/mobile/docs/secure-storage-sdk-ig-available-methods-5-8-0#Tab_Volatile_Storage_Management) and [Permanent Storage Management](/mobile/docs/secure-storage-sdk-ig-available-methods-5-8-0#Tab_Permanent_Storage_Management) to delete the permanent storage and clear the volatile storage. Afterward, you should initialize the secure storage again. The data will be lost. ## Android Exceptions When an error occurs on Android, a SecureStorageSDKException is thrown. This exception consists of an error code and, if the exception is an internal error, the cause of the exception. Storage that is non-persistent and keeps stored information as long as the app lifecycle is not fully terminated. Requires power to maintain the stored information. Also “non-volatile storage”. Storage that can retrieve persistent information which was previously stored in the app keychain using the Secure Storage SDK (Write Storage API). Can retrieve stored information even after having been power-cycled.