OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MAC_SECURITY_WRAPPERS_H_ | 5 #ifndef CHROME_BROWSER_MAC_SECURITY_WRAPPERS_H_ |
6 #define CHROME_BROWSER_MAC_SECURITY_WRAPPERS_H_ | 6 #define CHROME_BROWSER_MAC_SECURITY_WRAPPERS_H_ |
7 | 7 |
8 #include <Security/Security.h> | 8 #include <Security/Security.h> |
9 #include <Security/SecRequirement.h> | 9 #include <Security/SecRequirement.h> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 CrSKeychainItemAndAccess(const CrSKeychainItemAndAccess& that); | 38 CrSKeychainItemAndAccess(const CrSKeychainItemAndAccess& that); |
39 | 39 |
40 ~CrSKeychainItemAndAccess(); | 40 ~CrSKeychainItemAndAccess(); |
41 | 41 |
42 void operator=(const CrSKeychainItemAndAccess& that); | 42 void operator=(const CrSKeychainItemAndAccess& that); |
43 | 43 |
44 SecKeychainItemRef item() const { return item_; } | 44 SecKeychainItemRef item() const { return item_; } |
45 SecAccessRef access() const { return access_; } | 45 SecAccessRef access() const { return access_; } |
46 | 46 |
47 private: | 47 private: |
48 base::mac::ScopedCFTypeRef<SecKeychainItemRef> item_; | 48 base::ScopedCFTypeRef<SecKeychainItemRef> item_; |
49 base::mac::ScopedCFTypeRef<SecAccessRef> access_; | 49 base::ScopedCFTypeRef<SecAccessRef> access_; |
50 }; | 50 }; |
51 | 51 |
52 // Holds the return value from CrSACLCopySimpleContents and an argument to | 52 // Holds the return value from CrSACLCopySimpleContents and an argument to |
53 // CrSACLSetSimpleContents, managing ownership. Used in those wrappers to keep | 53 // CrSACLSetSimpleContents, managing ownership. Used in those wrappers to keep |
54 // logically grouped data together. | 54 // logically grouped data together. |
55 struct CrSACLSimpleContents { | 55 struct CrSACLSimpleContents { |
56 CrSACLSimpleContents(); | 56 CrSACLSimpleContents(); |
57 ~CrSACLSimpleContents(); | 57 ~CrSACLSimpleContents(); |
58 | 58 |
59 base::mac::ScopedCFTypeRef<CFArrayRef> application_list; | 59 base::ScopedCFTypeRef<CFArrayRef> application_list; |
60 base::mac::ScopedCFTypeRef<CFStringRef> description; | 60 base::ScopedCFTypeRef<CFStringRef> description; |
61 CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR prompt_selector; | 61 CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR prompt_selector; |
62 }; | 62 }; |
63 | 63 |
64 // Holds a SecKeychainAttributeInfo*, calling SecKeychainFreeAttributeInfo on | 64 // Holds a SecKeychainAttributeInfo*, calling SecKeychainFreeAttributeInfo on |
65 // destruction. | 65 // destruction. |
66 class ScopedSecKeychainAttributeInfo { | 66 class ScopedSecKeychainAttributeInfo { |
67 public: | 67 public: |
68 explicit ScopedSecKeychainAttributeInfo( | 68 explicit ScopedSecKeychainAttributeInfo( |
69 SecKeychainAttributeInfo* attribute_info); | 69 SecKeychainAttributeInfo* attribute_info); |
70 ~ScopedSecKeychainAttributeInfo(); | 70 ~ScopedSecKeychainAttributeInfo(); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // CrSKeychainItemAttributesAndData argument, returning NULL on error or a | 223 // CrSKeychainItemAttributesAndData argument, returning NULL on error or a |
224 // SecKeychainItemRef owned by the caller on success. | 224 // SecKeychainItemRef owned by the caller on success. |
225 SecKeychainItemRef CrSKeychainItemCreateFromContent( | 225 SecKeychainItemRef CrSKeychainItemCreateFromContent( |
226 const CrSKeychainItemAttributesAndData& attributes_and_data, | 226 const CrSKeychainItemAttributesAndData& attributes_and_data, |
227 SecKeychainRef keychain, | 227 SecKeychainRef keychain, |
228 SecAccessRef access); | 228 SecAccessRef access); |
229 | 229 |
230 } // namespace chrome | 230 } // namespace chrome |
231 | 231 |
232 #endif // CHROME_BROWSER_MAC_SECURITY_WRAPPERS_H_ | 232 #endif // CHROME_BROWSER_MAC_SECURITY_WRAPPERS_H_ |
OLD | NEW |