File indexing completed on 2024-05-12 16:25:01
0001 /* 0002 File: KeychainItemWrapper.h 0003 Abstract: 0004 Objective-C wrapper for accessing a single keychain item. 0005 0006 Version: 1.2 0007 0008 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 0009 Inc. ("Apple") in consideration of your agreement to the following 0010 terms, and your use, installation, modification or redistribution of 0011 this Apple software constitutes acceptance of these terms. If you do 0012 not agree with these terms, please do not use, install, modify or 0013 redistribute this Apple software. 0014 0015 In consideration of your agreement to abide by the following terms, and 0016 subject to these terms, Apple grants you a personal, non-exclusive 0017 license, under Apple's copyrights in this original Apple software (the 0018 "Apple Software"), to use, reproduce, modify and redistribute the Apple 0019 Software, with or without modifications, in source and/or binary forms; 0020 provided that if you redistribute the Apple Software in its entirety and 0021 without modifications, you must retain this notice and the following 0022 text and disclaimers in all such redistributions of the Apple Software. 0023 Neither the name, trademarks, service marks or logos of Apple Inc. may 0024 be used to endorse or promote products derived from the Apple Software 0025 without specific prior written permission from Apple. Except as 0026 expressly stated in this notice, no other rights or licenses, express or 0027 implied, are granted by Apple herein, including but not limited to any 0028 patent rights that may be infringed by your derivative works or by other 0029 works in which the Apple Software may be incorporated. 0030 0031 The Apple Software is provided by Apple on an "AS IS" basis. APPLE 0032 MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 0033 THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 0034 FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 0035 OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 0036 0037 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 0038 OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 0039 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 0040 INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 0041 MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 0042 AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 0043 STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 0044 POSSIBILITY OF SUCH DAMAGE. 0045 0046 Copyright (C) 2010 Apple Inc. All Rights Reserved. 0047 0048 */ 0049 0050 @import Foundation; 0051 0052 /* 0053 The KeychainItemWrapper class is an abstraction layer for the iPhone Keychain communication. It is merely a 0054 simple wrapper to provide a distinct barrier between all the idiosyncrasies involved with the Keychain 0055 CF/NS container objects. 0056 */ 0057 @interface KeychainItemWrapper : NSObject 0058 { 0059 NSMutableDictionary *keychainItemData; // The actual keychain item data backing store. 0060 NSMutableDictionary *genericPasswordQuery; // A placeholder for the generic keychain item query used to locate the item. 0061 } 0062 0063 @property (nonatomic, retain) NSMutableDictionary *keychainItemData; 0064 @property (nonatomic, retain) NSMutableDictionary *genericPasswordQuery; 0065 0066 // Designated initializer. 0067 - (id)initWithIdentifier: (NSString *)identifier accessGroup:(NSString *) accessGroup; 0068 - (void)setObject:(id)inObject forKey:(id)key; 0069 - (id)objectForKey:(id)key; 0070 0071 // Initializes and resets the default generic keychain item data. 0072 - (void)resetKeychainItem; 0073 0074 @end