This version of Astro is only compatible with Xcode 7.3
Menu

Secure Store Plugin

The secure store plugin allows you to securely store and retrieve items. It is currently best suited for storing cryptographic keys, but is also able to store other types of data.

On iOS, the items are stored in the system keychain and are decrypted and available for use only when the device is unlocked. Note that multiple instances of the secure store plugin are backed by the same system store.

On Android, the items are stored in a shared preference file that is created specifically for secure store plugin. This shared preference file is protected so that only the app that creates it may access it. The items are encrypted with a generated asymmetric key. The asymmetric key is stored in Android's KeyStore system. Note that multiple instances of the secure store plugin are backed by the same system store.

The secure store plugin is useful if you need to store data that is accessible only while the app is in the foreground and that does not migrate to a new device.

One example use is to securely store OAuth tokens.

Sample Usage

SecureStorePlugin.init().then(function(secureStore) {
    secureStore.set('some key', 'some super secret value');
    secureStore.get('some key', function(value) {
        alert('Retrieved value: ' + value);
    });
});

Methods

SecureStorePlugin.init() #

Creates and returns an instance of the secure store plugin that is used to make subsequent method calls.


set(key, value) #

Sets an item in the secure store.


get(key) #

Returns the value of the item with the given key in the secure store.


delete(key) #

Deletes an item with the given key from the secure store.


clear() #

Clears all items in the secure store.