-
Notifications
You must be signed in to change notification settings - Fork 10
/
MCSMKeychainItem.h
106 lines (79 loc) · 4.57 KB
/
MCSMKeychainItem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//
// MCSMKeychainItem.h
// MCSMSecurity
//
// Created by Spencer MacDonald on 12/10/2011.
// Copyright 2012 Square Bracket Software. All rights reserved.
//
@import Foundation;
@import Security;
extern NSString * const MCSMKeychainItemQueryKey;
@interface MCSMKeychainItem : NSObject
#if TARGET_OS_MAC && !TARGET_IPHONE_SIMULATOR && !TARGET_OS_IPHONE
+ (void)lockKeychain;
+ (void)unlockKeychain;
#endif
@property (readonly, copy) NSString *account;
@property (readonly, strong) NSDictionary *attributes;
@property (readonly, copy) NSString *password;
// Keyed Subscript Accessor for attributes
- (id)objectForKeyedSubscript:(id <NSCopying>)key;
- (BOOL)removeFromKeychainWithError:(NSError *__autoreleasing *)error;
@end
@interface MCSMGenericKeychainItem : MCSMKeychainItem
@property (readonly, copy) NSString *service;
+ (NSArray *)genericKeychainItemsForService:(NSString *)service
attributes:(NSDictionary *)attributes
error:(NSError *__autoreleasing *)error;
+ (MCSMGenericKeychainItem *)genericKeychainItemForService:(NSString *)service
account:(NSString *)account
attributes:(NSDictionary *)attributes
error:(NSError *__autoreleasing *)error;
+ (MCSMGenericKeychainItem *)genericKeychainItemWithService:(NSString *)service
account:(NSString *)account
attributes:(NSDictionary *)attributes
password:(NSString *)password
error:(NSError *__autoreleasing *)error;
@end
@interface MCSMInternetKeychainItem : MCSMKeychainItem
@property (readonly, copy) NSString *server;
@property (readonly, copy) NSString *securityDomain;
@property (readonly, copy) NSString *path;
@property (readonly, assign) NSUInteger port;
@property (readonly, assign) CFTypeRef protocol;
@property (readonly, assign) CFTypeRef authenticationType;
+ (NSArray *)internetKeychainItemsForServer:(NSString *)server
securityDomain:(NSString *)securityDomain
path:(NSString *)path
port:(NSUInteger)port
protocol:(CFTypeRef)protocol
authenticationType:(CFTypeRef)authenticationType
attributes:(NSDictionary *)attributes
error:(NSError *__autoreleasing *)error;
+ (MCSMInternetKeychainItem *)internetKeychainItemForServer:(NSString *)server
securityDomain:(NSString *)securityDomain
account:(NSString *)account
path:(NSString *)path
port:(NSUInteger)port
protocol:(CFTypeRef)protocol
authenticationType:(CFTypeRef)authenticationType
attributes:(NSDictionary *)attributes
error:(NSError *__autoreleasing *)error;
+ (MCSMInternetKeychainItem *)internetKeychainItemWithServer:(NSString *)server
securityDomain:(NSString *)securityDomain
account:(NSString *)account
path:(NSString *)path
port:(NSUInteger)port
protocol:(CFTypeRef)protocol
authenticationType:(CFTypeRef)authenticationType
attributes:(NSDictionary *)attributes
password:(NSString *)password
error:(NSError *__autoreleasing *)error;
@end
extern NSString *const MCSMApplicationUUIDKeychainItemService;
@interface MCSMApplicationUUIDKeychainItem : MCSMGenericKeychainItem
@property (readonly, copy) NSString *UUID;
+ (MCSMApplicationUUIDKeychainItem *)generateApplicationUUIDKeychainItem;
+ (MCSMApplicationUUIDKeychainItem *)applicationUUIDKeychainItem;
+ (NSString *)applicationUUID;
@end