Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_CERT_KEYCHAIN_SEARCH_LIST_MAC_H_ | |
| 6 #define NET_CERT_KEYCHAIN_SEARCH_LIST_MAC_H_ | |
| 7 | |
| 8 #include <CoreServices/CoreServices.h> | |
| 9 #include <Security/Security.h> | |
| 10 | |
| 11 #include "base/mac/scoped_cftyperef.h" | |
| 12 #include "net/base/net_export.h" | |
| 13 | |
| 14 namespace net { | |
| 15 | |
| 16 class NET_EXPORT TestKeychainSearchList { | |
|
Ryan Sleevi
2016/06/30 01:50:00
For this, do we need a dedicated class? Or can thi
mattm
2016/06/30 03:20:53
The keychain reordering hack in CertVerifyProcMac
| |
| 17 public: | |
| 18 ~TestKeychainSearchList(); | |
| 19 | |
| 20 // Creates a TestKeychainSearchList, which will be used by HasInstance and | |
| 21 // GetInstance. | |
| 22 // Only one TestKeychainSearchList object may exist at a time, returns nullptr | |
| 23 // if one exists already. | |
| 24 static std::unique_ptr<TestKeychainSearchList> Create(); | |
| 25 | |
| 26 // Returns true if a TestKeychainSearchList currently exists. | |
| 27 static bool HasInstance(); | |
| 28 | |
| 29 // Returns the current TestKeychainSearchList instance, if any. | |
| 30 static TestKeychainSearchList* GetInstance(); | |
| 31 | |
| 32 // Copies the test keychain search list into |keychain_search_list|. | |
| 33 OSStatus CopySearchList(CFArrayRef* keychain_search_list) const; | |
| 34 | |
| 35 // Adds |keychain| to the end of the test keychain search list. | |
| 36 void AddKeychain(SecKeychainRef keychain); | |
| 37 | |
| 38 private: | |
| 39 TestKeychainSearchList(); | |
| 40 | |
| 41 base::ScopedCFTypeRef<CFMutableArrayRef> scoped_keychain_search_list; | |
| 42 }; | |
| 43 | |
| 44 } // namespace net | |
| 45 | |
| 46 #endif // NET_CERT_KEYCHAIN_SEARCH_LIST_MAC_H_ | |
| OLD | NEW |