Skip to content

Commit f2c62fc

Browse files
author
Darcy Liu
committed
add GenericKeychain
1 parent a3a32ff commit f2c62fc

30 files changed

Lines changed: 3208 additions & 1 deletion

GenericKeychain.zip

116 KB
Binary file not shown.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
File: AppDelegate.h
3+
Abstract:
4+
Application delegate, loaded with MainWindow nib and does basic UI
5+
setup. Also creates the keychain item wrapper objects.
6+
7+
Version: 1.2
8+
9+
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
10+
Inc. ("Apple") in consideration of your agreement to the following
11+
terms, and your use, installation, modification or redistribution of
12+
this Apple software constitutes acceptance of these terms. If you do
13+
not agree with these terms, please do not use, install, modify or
14+
redistribute this Apple software.
15+
16+
In consideration of your agreement to abide by the following terms, and
17+
subject to these terms, Apple grants you a personal, non-exclusive
18+
license, under Apple's copyrights in this original Apple software (the
19+
"Apple Software"), to use, reproduce, modify and redistribute the Apple
20+
Software, with or without modifications, in source and/or binary forms;
21+
provided that if you redistribute the Apple Software in its entirety and
22+
without modifications, you must retain this notice and the following
23+
text and disclaimers in all such redistributions of the Apple Software.
24+
Neither the name, trademarks, service marks or logos of Apple Inc. may
25+
be used to endorse or promote products derived from the Apple Software
26+
without specific prior written permission from Apple. Except as
27+
expressly stated in this notice, no other rights or licenses, express or
28+
implied, are granted by Apple herein, including but not limited to any
29+
patent rights that may be infringed by your derivative works or by other
30+
works in which the Apple Software may be incorporated.
31+
32+
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
33+
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
34+
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
35+
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
36+
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
37+
38+
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
39+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
40+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41+
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
42+
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
43+
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
44+
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
45+
POSSIBILITY OF SUCH DAMAGE.
46+
47+
Copyright (C) 2010 Apple Inc. All Rights Reserved.
48+
49+
*/
50+
51+
#import <UIKit/UIKit.h>
52+
53+
@class KeychainItemWrapper, DetailViewController;
54+
55+
@interface AppDelegate : NSObject <UIApplicationDelegate>
56+
{
57+
UIWindow *window;
58+
UINavigationController *navigationController;
59+
DetailViewController *detailViewController;
60+
KeychainItemWrapper *passwordItem;
61+
KeychainItemWrapper *accountNumberItem;
62+
}
63+
64+
@property (nonatomic, retain) IBOutlet UIWindow *window;
65+
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
66+
@property (nonatomic, retain) IBOutlet DetailViewController *detailViewController;
67+
@property (nonatomic, retain) KeychainItemWrapper *passwordItem;
68+
@property (nonatomic, retain) KeychainItemWrapper *accountNumberItem;
69+
70+
@end
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
File: AppDelegate.m
3+
Abstract:
4+
Application delegate, loaded with MainWindow nib and does basic UI
5+
setup. Also creates the keychain item wrapper objects.
6+
7+
Version: 1.2
8+
9+
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
10+
Inc. ("Apple") in consideration of your agreement to the following
11+
terms, and your use, installation, modification or redistribution of
12+
this Apple software constitutes acceptance of these terms. If you do
13+
not agree with these terms, please do not use, install, modify or
14+
redistribute this Apple software.
15+
16+
In consideration of your agreement to abide by the following terms, and
17+
subject to these terms, Apple grants you a personal, non-exclusive
18+
license, under Apple's copyrights in this original Apple software (the
19+
"Apple Software"), to use, reproduce, modify and redistribute the Apple
20+
Software, with or without modifications, in source and/or binary forms;
21+
provided that if you redistribute the Apple Software in its entirety and
22+
without modifications, you must retain this notice and the following
23+
text and disclaimers in all such redistributions of the Apple Software.
24+
Neither the name, trademarks, service marks or logos of Apple Inc. may
25+
be used to endorse or promote products derived from the Apple Software
26+
without specific prior written permission from Apple. Except as
27+
expressly stated in this notice, no other rights or licenses, express or
28+
implied, are granted by Apple herein, including but not limited to any
29+
patent rights that may be infringed by your derivative works or by other
30+
works in which the Apple Software may be incorporated.
31+
32+
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
33+
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
34+
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
35+
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
36+
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
37+
38+
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
39+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
40+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41+
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
42+
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
43+
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
44+
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
45+
POSSIBILITY OF SUCH DAMAGE.
46+
47+
Copyright (C) 2010 Apple Inc. All Rights Reserved.
48+
49+
*/
50+
51+
#import "AppDelegate.h"
52+
#import "DetailViewController.h"
53+
#import "KeychainItemWrapper.h"
54+
55+
@implementation AppDelegate
56+
57+
@synthesize window, navigationController, detailViewController, passwordItem, accountNumberItem;
58+
59+
- (void)dealloc
60+
{
61+
[detailViewController release];
62+
[navigationController release];
63+
[window release];
64+
[passwordItem release];
65+
[accountNumberItem release];
66+
67+
[super dealloc];
68+
}
69+
70+
- (void)applicationDidFinishLaunching:(UIApplication *)application
71+
{
72+
KeychainItemWrapper *wrapper = [[KeychainItemWrapper alloc] initWithIdentifier:@"Password" accessGroup:nil];
73+
self.passwordItem = wrapper;
74+
detailViewController.passwordItem = wrapper;
75+
[wrapper release];
76+
77+
wrapper = [[KeychainItemWrapper alloc] initWithIdentifier:@"Account Number" accessGroup:@"YOUR_APP_ID_HERE.com.yourcompany.GenericKeychainSuite"];
78+
self.accountNumberItem = wrapper;
79+
detailViewController.accountNumberItem = wrapper;
80+
[wrapper release];
81+
82+
[window addSubview:navigationController.view];
83+
[window makeKeyAndVisible];
84+
}
85+
86+
@end
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
File: DetailViewController.h
3+
Abstract:
4+
Controller for editing text view data.
5+
6+
Version: 1.2
7+
8+
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
9+
Inc. ("Apple") in consideration of your agreement to the following
10+
terms, and your use, installation, modification or redistribution of
11+
this Apple software constitutes acceptance of these terms. If you do
12+
not agree with these terms, please do not use, install, modify or
13+
redistribute this Apple software.
14+
15+
In consideration of your agreement to abide by the following terms, and
16+
subject to these terms, Apple grants you a personal, non-exclusive
17+
license, under Apple's copyrights in this original Apple software (the
18+
"Apple Software"), to use, reproduce, modify and redistribute the Apple
19+
Software, with or without modifications, in source and/or binary forms;
20+
provided that if you redistribute the Apple Software in its entirety and
21+
without modifications, you must retain this notice and the following
22+
text and disclaimers in all such redistributions of the Apple Software.
23+
Neither the name, trademarks, service marks or logos of Apple Inc. may
24+
be used to endorse or promote products derived from the Apple Software
25+
without specific prior written permission from Apple. Except as
26+
expressly stated in this notice, no other rights or licenses, express or
27+
implied, are granted by Apple herein, including but not limited to any
28+
patent rights that may be infringed by your derivative works or by other
29+
works in which the Apple Software may be incorporated.
30+
31+
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
32+
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
33+
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
34+
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
35+
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
36+
37+
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
38+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
39+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
40+
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
41+
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
42+
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
43+
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
44+
POSSIBILITY OF SUCH DAMAGE.
45+
46+
Copyright (C) 2010 Apple Inc. All Rights Reserved.
47+
48+
*/
49+
50+
#import <UIKit/UIkit.h>
51+
52+
@class EditorController;
53+
@class KeychainItemWrapper;
54+
55+
@interface DetailViewController : UIViewController <UITableViewDataSource, UITableViewDelegate, UIActionSheetDelegate>
56+
{
57+
UITableView *tableView;
58+
EditorController *textFieldController;
59+
KeychainItemWrapper *passwordItem;
60+
KeychainItemWrapper *accountNumberItem;
61+
}
62+
63+
@property (nonatomic, retain) IBOutlet UITableView *tableView;
64+
@property (nonatomic, retain) IBOutlet EditorController *textFieldController;
65+
@property (nonatomic, retain) KeychainItemWrapper *passwordItem;
66+
@property (nonatomic, retain) KeychainItemWrapper *accountNumberItem;
67+
68+
+ (NSString *)titleForSection:(NSInteger)section;
69+
+ (id)secAttrForSection:(NSInteger)section;
70+
71+
- (IBAction)resetKeychain:(id)sender;
72+
73+
@end

0 commit comments

Comments
 (0)