Inherits from NSObject
Declared in SPiDKeychainWrapper.h
SPiDKeychainWrapper.m

Overview

SPiDKeychainWrapper is a wrapper used to simplfy keychain access. It is used by the SPiDClient for all keychain operations. Note that all keychain items are available in the iPhone simulator to all apps since the application is not signed!

Tasks

Public methods

Private methods

Class Methods

getAccessTokenFromKeychainForIdentifier:

Get access token from keychain Tries to load the access token from the keychain

+ (SPiDAccessToken *)getAccessTokenFromKeychainForIdentifier:(NSString *)identifier

Parameters

identifier

Unique identification for this keychain item

Return Value

Access token if available otherwise nil

Declared In

SPiDKeychainWrapper.h

removeAccessTokenFromKeychainForIdentifier:

Remove access token from keychain Tries to remove the access token from the keychain

+ (void)removeAccessTokenFromKeychainForIdentifier:(NSString *)identifier

Parameters

identifier

Unique identification for this keychain item

Declared In

SPiDKeychainWrapper.h

serviceNameForSPiD

Generates a service name to use for the keychain

+ (NSString *)serviceNameForSPiD

Return Value

Service name

Discussion

The service will have the form ‘bundleIdentifier-SPiD’

Declared In

SPiDKeychainWrapper.m

setupSearchQueryForIdentifier:

Creates the basic search query used for all keychain operations

+ (NSMutableDictionary *)setupSearchQueryForIdentifier:(NSString *)identifier

Parameters

identifier

Unique identifier for the keychain item

Return Value

Query as a NSMutableDictionary

Declared In

SPiDKeychainWrapper.m

storeInKeychainAccessTokenWithValue:forIdentifier:

Saves access token to keychain Tries to save the access token to the keychain

+ (BOOL)storeInKeychainAccessTokenWithValue:(SPiDAccessToken *)accessToken forIdentifier:(NSString *)identifier

Parameters

accessToken

Access token to save

identifier

Unique identification for this keychain item

Return Value

Access token if available otherwise nil

Declared In

SPiDKeychainWrapper.h

updateAccessTokenInKeychainWithValue:forIdentifier:

Update access token in keychain Tries to update the access token in the keychain

+ (BOOL)updateAccessTokenInKeychainWithValue:(SPiDAccessToken *)accessToken forIdentifier:(NSString *)identifier

Parameters

accessToken

Access token to save

identifier

Unique identification for this keychain item

Return Value

YES if successful otherwise NO

Declared In

SPiDKeychainWrapper.h