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_VERIFIER_H_ | 5 #ifndef BASE_CRYPTO_SIGNATURE_VERIFIER_H_ |
6 #define BASE_CRYPTO_SIGNATURE_VERIFIER_H_ | 6 #define BASE_CRYPTO_SIGNATURE_VERIFIER_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 #include <cryptoht.h> |
12 #elif defined(OS_MACOSX) | 12 #elif defined(OS_MACOSX) |
13 #include <Security/cssm.h> | 13 #include <Security/cssm.h> |
14 #elif defined(OS_WIN) | |
15 #include <windows.h> | |
16 #include <wincrypt.h> | |
17 #endif | 14 #endif |
18 | 15 |
19 #include <vector> | 16 #include <vector> |
20 | 17 |
21 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
22 | 19 |
| 20 #if defined(OS_WIN) |
| 21 #include "base/crypto/scoped_capi_types.h" |
| 22 #endif |
| 23 |
23 namespace base { | 24 namespace base { |
24 | 25 |
25 // The SignatureVerifier class verifies a signature using a bare public key | 26 // The SignatureVerifier class verifies a signature using a bare public key |
26 // (as opposed to a certificate). | 27 // (as opposed to a certificate). |
27 class SignatureVerifier { | 28 class SignatureVerifier { |
28 public: | 29 public: |
29 SignatureVerifier(); | 30 SignatureVerifier(); |
30 ~SignatureVerifier(); | 31 ~SignatureVerifier(); |
31 | 32 |
32 // Streaming interface: | 33 // Streaming interface: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 84 |
84 #if defined(USE_NSS) | 85 #if defined(USE_NSS) |
85 VFYContext* vfy_context_; | 86 VFYContext* vfy_context_; |
86 #elif defined(OS_MACOSX) | 87 #elif defined(OS_MACOSX) |
87 std::vector<uint8> public_key_info_; | 88 std::vector<uint8> public_key_info_; |
88 | 89 |
89 CSSM_CC_HANDLE sig_handle_; | 90 CSSM_CC_HANDLE sig_handle_; |
90 | 91 |
91 CSSM_KEY public_key_; | 92 CSSM_KEY public_key_; |
92 #elif defined(OS_WIN) | 93 #elif defined(OS_WIN) |
93 HCRYPTPROV provider_; | 94 ScopedHCRYPTPROV provider_; |
94 | 95 |
95 HCRYPTHASH hash_object_; | 96 ScopedHCRYPTHASH hash_object_; |
96 | 97 |
97 HCRYPTKEY public_key_; | 98 ScopedHCRYPTKEY public_key_; |
98 #endif | 99 #endif |
99 }; | 100 }; |
100 | 101 |
101 } // namespace base | 102 } // namespace base |
102 | 103 |
103 #endif // BASE_CRYPTO_SIGNATURE_VERIFIER_H_ | 104 #endif // BASE_CRYPTO_SIGNATURE_VERIFIER_H_ |
OLD | NEW |