0.01
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Simple wrapper for Keychain on iOS and OS X.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

motion-keychain

Gem Version

Securely store data in RubyMotion.

The motion-keychain gem is a simple wrapper for Keychain on iOS and OS X. Makes using Keychain APIs as easy as NSUserDefaults.

Installation

Add this line to your application's Gemfile:

gem 'motion-keychain'

And then execute:

$ bundle

Or install it yourself as:

$ gem install motion-keychain

Usage

Store secure data:

  # Storing securely under key 'password'
  MotionKeychain.set('password', @password.text)

Retrieve secure data:

  # Retrieving 'password' content from keychain
  @password.text = MotionKeychain.get('password')

Wipe secure data:

  # User is logging out
  MotionKeychain.remove('password')

Keychain access groups

If you want the new keychain item to be shared among multiple applications, (i.e. include the kSecAttrAccessGroup key in the attributes dictionary), the value of your key must be the name of a keychain access group to which all of the programs that will share this item belong.

This area needs more field-testing but for RubyMotion this means setting the entitlements in your Rakefile. E.G.

  app.identifier = 'com.apple.myapp'
  app.seed_id = '659823F3DC53'
  app.entitlements['keychain-access-groups'] = [app.seed_id + '.' + app.identifier]

TODO

  • Remove cocoapod dependency and move to pure RubyMotion implementation. (v0.1.0)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request