Coder Social home page Coder Social logo

hoodman1 / keyshareconsumer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from purebred/keyshareconsumer

0.0 0.0 0.0 151 KB

Sample project demonstrating usage of Purebred Registration's document provider extension to import keys.

License: The Unlicense

C 54.40% Objective-C 33.64% Objective-C++ 11.96%

keyshareconsumer's Introduction

The KeyShareConsumer app is intended to illustrate usage of the document provider interface exposed by the Purebred Registration app. This interface can be used to import cryptographic keys provisioned using the Purebred Registration app, the SampleKeyProvider app or PKCS12 files stored in the user's iCloud account.

Document provider extensions were introduced in iOS 8 and are described here. As additional background, a sample document provider was presented during the WWDC 2014 conference. Source code is available here.

Purebred Registration provides the key sharing interface as an easier alternative to importing PKCS12 files using iTunes file sharing or implementing support for a certificate enrollment protocol. Using the interface requires your app to present the UIDocumentPickerViewController, which will enable the user to select which key to import, and implement the UIDocumentPickerDelegate interface, which will enable your app to import keys. In the Key Share Consumer sample, this code is present in ViewController.m. A UIDocumentPickerViewController instance is displayed in the click handler for the "Import Key" button. The ViewController class implements UIDocumentPickerDelegate.

When the user uses the Purebred Registration app interface, the PKCS12 password is passed to your app via the pasteboard. When the user selects a file from their iCloud account, the user will need to be prompted to enter a password. In either case, the PKCS12 file and password are processed in the importP12 method of the ViewController class. To enable the Purebred Registration interface tap Import Key then tap Locations. This will display a list of providers including More. Tap More. If the Purebred Registration app is installed, it will be listed on the Manage Storage Providers view. Turn the switch on for the Purebred Key Chain row then tap Done. Now when Import Key and Locations are tapped, the Purebred Key Chain option will be available.

The list of keys displayed by a provider can be filtered using a uniform type identifier (UTI) value that indicates the type of key the caller wants to import. The list of UTIs currently supported by the Purebred Registration app and SampleKeyProvider app are as follows:

  • com.rsa.pkcs-12
  • purebred.select.all
  • purebred.select.all_user
  • purebred.select.all-user
  • purebred.select.device
  • purebred.select.signature
  • purebred.select.encryption
  • purebred.select.authentication
  • purebred.select.no_filter
  • purebred.select.no-filter
  • purebred.zip.all
  • purebred.zip.all_user
  • purebred.zip.all-user
  • purebred.zip.device
  • purebred.zip.signature
  • purebred.zip.encryption
  • purebred.zip.authentication
  • purebred.zip.no_filter
  • purebred.zip.no-filter

NOTE* UTI values with "-" have been added to support custom app distribution as "_" are not allowed.

Bundle identifiers need to be updated to reflect bundle identifiers associated with the signer. These include:

Bundle Identifier for KeyShareConsumer

By default, the Purebred Registration app serves up the most recent keys for the indicated types. The no_filter option can be used to cause all available keys for the indicated types to be displayed.

Details on obtaining and testing the Purebred Registration app will be posted soon. See here.

ViewController.h/ViewController.m

Main view controller that enables the user to import a key into Key Share Consumer's key chain or to clear the contents of Key Share Consumer's key chain. Code related to key sharing interface is in the import button click handler and the UIDocumentPickerDelegate implementation. Implements UITableViewDelegate and UITableViewDataSource to display items from the key chain, as served by an instance of KeyChainDataSource.

KeyChainDataSource.h/KeyChainDataSource.mm

Provides interface to key chain to populate table views.

KeyDetailViewController.h/KeyDetailViewController.m

Sample view controller to display details of a selected key chain item. Implements UITableViewDelegate and UITableViewDataSource to display details of a selected item from the key chain, as served by an instance of KeyChainDataSource.

AppDelegate.h/AppDelegate.m

Uninteresting boilerplate AppDelegate implementation.

keyshareconsumer's People

Contributors

carl-wallace avatar purebred avatar agalustyan 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.