/C13-Networking/09-UNPW Settings Screen/Apple/KeychainItemWrapper.h

http://github.com/erica/iphone-3.0-cookbook- · C Header · 75 lines · 13 code · 6 blank · 56 comment · 0 complexity · 20ea7741e92e507987a30487fe915e20 MD5 · raw file

  1. /*
  2. File: KeychainItemWrapper.h
  3. Abstract: Objective-C wrapper for accessing a single keychain item.
  4. Version: 1.1
  5. Disclaimer: IMPORTANT: This Apple software is supplied to you by
  6. Apple Inc. ("Apple") in consideration of your agreement to the
  7. following terms, and your use, installation, modification or
  8. redistribution of this Apple software constitutes acceptance of these
  9. terms. If you do not agree with these terms, please do not use,
  10. install, modify or redistribute this Apple software.
  11. In consideration of your agreement to abide by the following terms, and
  12. subject to these terms, Apple grants you a personal, non-exclusive
  13. license, under Apple's copyrights in this original Apple software (the
  14. "Apple Software"), to use, reproduce, modify and redistribute the Apple
  15. Software, with or without modifications, in source and/or binary forms;
  16. provided that if you redistribute the Apple Software in its entirety and
  17. without modifications, you must retain this notice and the following
  18. text and disclaimers in all such redistributions of the Apple Software.
  19. Neither the name, trademarks, service marks or logos of Apple Inc.
  20. may be used to endorse or promote products derived from the Apple
  21. Software without specific prior written permission from Apple. Except
  22. as expressly stated in this notice, no other rights or licenses, express
  23. or implied, are granted by Apple herein, including but not limited to
  24. any patent rights that may be infringed by your derivative works or by
  25. other works in which the Apple Software may be incorporated.
  26. The Apple Software is provided by Apple on an "AS IS" basis. APPLE
  27. MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
  28. THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
  29. FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
  30. OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
  31. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
  32. OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  33. SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  34. INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
  35. MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
  36. AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
  37. STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
  38. POSSIBILITY OF SUCH DAMAGE.
  39. Copyright (C) 2008-2009 Apple Inc. All Rights Reserved.
  40. */
  41. #import <UIKit/UIKit.h>
  42. /*
  43. The KeychainItemWrapper class is an abstraction layer for the iPhone Keychain communication. It is merely a
  44. simple wrapper to provide a distinct barrier between all the idiosyncracies involved with the Keychain
  45. CF/NS container objects.
  46. */
  47. @interface KeychainItemWrapper : NSObject
  48. {
  49. NSMutableDictionary *keychainItemData; // The actual keychain item data backing store.
  50. NSMutableDictionary *genericPasswordQuery; // A placeholder for the generic keychain item query used to locate the item.
  51. }
  52. @property (nonatomic, retain) NSMutableDictionary *keychainItemData;
  53. @property (nonatomic, retain) NSMutableDictionary *genericPasswordQuery;
  54. // Designated initializer.
  55. - (id)initWithIdentifier: (NSString *)identifier accessGroup:(NSString *) accessGroup;
  56. - (void)setObject:(id)inObject forKey:(id)key;
  57. - (id)objectForKey:(id)key;
  58. // Initializes and resets the default generic keychain item data.
  59. - (void)resetKeychainItem;
  60. @end