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_SIGNATURE_CREATOR_H_ | 5 #ifndef BASE_CRYPTO_SIGNATURE_CREATOR_H_ |
6 #define BASE_CRYPTO_SIGNATURE_CREATOR_H_ | 6 #define BASE_CRYPTO_SIGNATURE_CREATOR_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(USE_NSS) | 10 #if defined(USE_NSS) |
11 #include <cryptoht.h> | 11 // Forward declaration. |
| 12 struct SGNContextStr; |
12 #elif defined(OS_MACOSX) | 13 #elif defined(OS_MACOSX) |
13 #include <Security/cssm.h> | 14 #include <Security/cssm.h> |
14 #elif defined(OS_WIN) | 15 #elif defined(OS_WIN) |
15 #include <windows.h> | 16 #include <windows.h> |
16 #include <wincrypt.h> | 17 #include <wincrypt.h> |
17 #endif | 18 #endif |
18 | 19 |
19 #include <vector> | 20 #include <vector> |
20 | 21 |
21 #include "base/basictypes.h" | 22 #include "base/basictypes.h" |
(...skipping 17 matching lines...) Expand all Loading... |
39 // Finalize the signature. | 40 // Finalize the signature. |
40 bool Final(std::vector<uint8>* signature); | 41 bool Final(std::vector<uint8>* signature); |
41 | 42 |
42 private: | 43 private: |
43 // Private constructor. Use the Create() method instead. | 44 // Private constructor. Use the Create() method instead. |
44 SignatureCreator(); | 45 SignatureCreator(); |
45 | 46 |
46 RSAPrivateKey* key_; | 47 RSAPrivateKey* key_; |
47 | 48 |
48 #if defined(USE_NSS) | 49 #if defined(USE_NSS) |
49 SGNContext* sign_context_; | 50 SGNContextStr* sign_context_; |
50 #elif defined(OS_MACOSX) | 51 #elif defined(OS_MACOSX) |
51 CSSM_CSP_HANDLE csp_handle_; | 52 CSSM_CSP_HANDLE csp_handle_; |
52 CSSM_CC_HANDLE sig_handle_; | 53 CSSM_CC_HANDLE sig_handle_; |
53 #elif defined(OS_WIN) | 54 #elif defined(OS_WIN) |
54 HCRYPTHASH hash_object_; | 55 HCRYPTHASH hash_object_; |
55 #endif | 56 #endif |
56 | 57 |
57 DISALLOW_COPY_AND_ASSIGN(SignatureCreator); | 58 DISALLOW_COPY_AND_ASSIGN(SignatureCreator); |
58 }; | 59 }; |
59 | 60 |
60 } // namespace base | 61 } // namespace base |
61 | 62 |
62 #endif // BASE_CRYPTO_SIGNATURE_CREATOR_H_ | 63 #endif // BASE_CRYPTO_SIGNATURE_CREATOR_H_ |
OLD | NEW |