Coder Social home page Coder Social logo

securestorage's Introduction

Secure Storage Plugin for Xamarin and Windows Apps (Phone, Store, UWP)

The plugin can be used to Securely store sensitive data strings such as password, session token, credit card number etc. This plugin securely stores the strings across sessions on iOS, Android and Windows Apps including WP8, Store and UWP.

It has easy to use API of key-value pairs. The pairs are saved using platform specific encryption mechanism. It has no dependencies on any packages (including Xamarin.Forms, MVVMCross.). And can be used by any Xamarin or Windows app. It is open source.

Note

If your app fails to save values in iOS 10 Simulator, open the Entitlements.plist file and make sure that "Enable Keychain Access Groups" is checked. Also ensure that in Project->Options->iOS Bundle Signing, the Entitlements.plist is selected in Custom Entitlements for iPhoneSimulator platform. This happens only in iOS 10 Simulator due to https://forums.xamarin.com/discussion/77760/ios-10-keychain

Usage

It provides 4 methods.

SetValue - Stores the key and value.

CrossSecureStorage.Current.SetValue(“SessionToken”, “1234567890”);

GetValue - Returns the value for the given key. If not found, returns default value.

var sessionToken = CrossSecureStorage.Current.GetValue (“SessionToken”);

DeleteKey - Deletes the given key and corresponding value from the storage.

CrossSecureStorage.Current.DeleteKey(“SessionToken”);

HasKey - Checks if the given key exists in the storage.

var exists = CrossSecureStorage.Current.HasKey (“SessionToken”);

NOTE: In Android Apps, it is required that the password is set by the application prior to use.

SecureStorageImplementation.StoragePassword = "Your Password";

In Windows Apps, it is required that the password is set by the application prior to use.

WinSecureStorageBase.StoragePassword = "Your password";

Breaking change in 1.2 for Windows Phone 8.0 app. The following line

~~ SecureStorageImplementation.StoragePassword = "Your Password"; ~~

should be replaced with the line for all Windows Apps (as above)

The sample apps shows how to use it in Xamarin and in Windows Apps.

Plugin: http://www.nuget.org/packages/sameerIOTApps.Plugin.SecureStorage/

Blog: https://sameerkapps.wordpress.com/2016/02/01/secure-storage-plugin-for-xamarin/

#License MIT License.

securestorage's People

Contributors

sameerkapps avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.