OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_ENCRYPTOR_H_ | 5 #ifndef BASE_CRYPTO_ENCRYPTOR_H_ |
6 #define BASE_CRYPTO_ENCRYPTOR_H_ | 6 #define BASE_CRYPTO_ENCRYPTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/crypto/symmetric_key.h" | 10 #include "base/crypto/symmetric_key.h" |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
12 | 12 |
| 13 #if defined(USE_NSS) |
| 14 #include "base/crypto/scoped_nss_types.h" |
| 15 #elif defined(OS_WIN) |
| 16 #include "base/crypto/scoped_capi_types.h" |
| 17 #endif |
| 18 |
13 namespace base { | 19 namespace base { |
14 | 20 |
15 class Encryptor { | 21 class Encryptor { |
16 public: | 22 public: |
17 enum Mode { | 23 enum Mode { |
18 CBC | 24 CBC |
19 }; | 25 }; |
20 Encryptor(); | 26 Encryptor(); |
21 virtual ~Encryptor(); | 27 virtual ~Encryptor(); |
22 | 28 |
(...skipping 15 matching lines...) Expand all Loading... |
38 | 44 |
39 #if defined(USE_NSS) | 45 #if defined(USE_NSS) |
40 ScopedPK11Slot slot_; | 46 ScopedPK11Slot slot_; |
41 ScopedSECItem param_; | 47 ScopedSECItem param_; |
42 #elif defined(OS_MACOSX) | 48 #elif defined(OS_MACOSX) |
43 bool Crypt(int /*CCOperation*/ op, | 49 bool Crypt(int /*CCOperation*/ op, |
44 const std::string& input, | 50 const std::string& input, |
45 std::string* output); | 51 std::string* output); |
46 | 52 |
47 std::string iv_; | 53 std::string iv_; |
| 54 #elif defined(OS_WIN) |
| 55 ScopedHCRYPTKEY capi_key_; |
| 56 DWORD block_size_; |
48 #endif | 57 #endif |
49 }; | 58 }; |
50 | 59 |
51 } // namespace base | 60 } // namespace base |
52 | 61 |
53 #endif // BASE_CRYPTO_ENCRYPTOR_H_ | 62 #endif // BASE_CRYPTO_ENCRYPTOR_H_ |
OLD | NEW |