| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 BASE_CRYPTO_CSSM_INIT_H_ | 5 #ifndef BASE_CRYPTO_CSSM_INIT_H_ |
| 6 #define BASE_CRYPTO_CSSM_INIT_H_ | 6 #define BASE_CRYPTO_CSSM_INIT_H_ |
| 7 | 7 |
| 8 #include <Security/cssm.h> | 8 #include <Security/cssm.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 | 14 |
| 15 // Initialize CSSM if it isn't already initialized. This must be called before | 15 // Initialize CSSM if it isn't already initialized. This must be called before |
| 16 // any other CSSM functions. This function is thread-safe, and CSSM will only | 16 // any other CSSM functions. This function is thread-safe, and CSSM will only |
| 17 // ever be initialized once. CSSM will be properly shut down on program exit. | 17 // ever be initialized once. CSSM will be properly shut down on program exit. |
| 18 void EnsureCSSMInit(); | 18 void EnsureCSSMInit(); |
| 19 | 19 |
| 20 // Returns the shared CSP handle used by CSSM functions. |
| 21 CSSM_CSP_HANDLE GetSharedCSPHandle(); |
| 22 |
| 20 // Set of pointers to memory function wrappers that are required for CSSM | 23 // Set of pointers to memory function wrappers that are required for CSSM |
| 21 extern const CSSM_API_MEMORY_FUNCS kCssmMemoryFunctions; | 24 extern const CSSM_API_MEMORY_FUNCS kCssmMemoryFunctions; |
| 22 | 25 |
| 26 // Utility function to log an error message including the error name. |
| 27 void LogCSSMError(const char *function_name, CSSM_RETURN err); |
| 28 |
| 23 } // namespace base | 29 } // namespace base |
| 24 | 30 |
| 25 #endif // BASE_CRYPTO_CSSM_INIT_H_ | 31 #endif // BASE_CRYPTO_CSSM_INIT_H_ |
| OLD | NEW |