OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ |
6 #define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ | 6 #define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
12 #include "third_party/WebKit/public/platform/WebCrypto.h" | 11 #include "third_party/WebKit/public/platform/WebCrypto.h" |
13 | 12 |
14 namespace content { | 13 namespace content { |
15 | 14 |
16 class CONTENT_EXPORT WebCryptoImpl | 15 class CONTENT_EXPORT WebCryptoImpl |
17 : NON_EXPORTED_BASE(public WebKit::WebCrypto) { | 16 : NON_EXPORTED_BASE(public WebKit::WebCrypto) { |
18 public: | 17 public: |
19 WebCryptoImpl(); | 18 WebCryptoImpl(); |
20 | 19 |
(...skipping 10 matching lines...) Expand all Loading... |
31 unsigned data_size, | 30 unsigned data_size, |
32 WebKit::WebCryptoResult result); | 31 WebKit::WebCryptoResult result); |
33 virtual void digest( | 32 virtual void digest( |
34 const WebKit::WebCryptoAlgorithm& algorithm, | 33 const WebKit::WebCryptoAlgorithm& algorithm, |
35 const unsigned char* data, | 34 const unsigned char* data, |
36 unsigned data_size, | 35 unsigned data_size, |
37 WebKit::WebCryptoResult result); | 36 WebKit::WebCryptoResult result); |
38 virtual void generateKey( | 37 virtual void generateKey( |
39 const WebKit::WebCryptoAlgorithm& algorithm, | 38 const WebKit::WebCryptoAlgorithm& algorithm, |
40 bool extractable, | 39 bool extractable, |
41 WebKit::WebCryptoKeyUsageMask usage, | 40 WebKit::WebCryptoKeyUsageMask usage_mask, |
42 WebKit::WebCryptoResult result); | 41 WebKit::WebCryptoResult result); |
43 virtual void importKey( | 42 virtual void importKey( |
44 WebKit::WebCryptoKeyFormat format, | 43 WebKit::WebCryptoKeyFormat format, |
45 const unsigned char* key_data, | 44 const unsigned char* key_data, |
46 unsigned key_data_size, | 45 unsigned key_data_size, |
47 const WebKit::WebCryptoAlgorithm& algorithm, | 46 const WebKit::WebCryptoAlgorithm& algorithm_or_null, |
48 bool extractable, | 47 bool extractable, |
49 WebKit::WebCryptoKeyUsageMask usage_mask, | 48 WebKit::WebCryptoKeyUsageMask usage_mask, |
50 WebKit::WebCryptoResult result); | 49 WebKit::WebCryptoResult result); |
51 virtual void sign( | 50 virtual void sign( |
52 const WebKit::WebCryptoAlgorithm& algorithm, | 51 const WebKit::WebCryptoAlgorithm& algorithm, |
53 const WebKit::WebCryptoKey& key, | 52 const WebKit::WebCryptoKey& key, |
54 const unsigned char* data, | 53 const unsigned char* data, |
55 unsigned data_size, | 54 unsigned data_size, |
56 WebKit::WebCryptoResult result); | 55 WebKit::WebCryptoResult result); |
57 virtual void verifySignature( | 56 virtual void verifySignature( |
(...skipping 24 matching lines...) Expand all Loading... |
82 const unsigned char* data, | 81 const unsigned char* data, |
83 unsigned data_size, | 82 unsigned data_size, |
84 WebKit::WebArrayBuffer* buffer); | 83 WebKit::WebArrayBuffer* buffer); |
85 bool DigestInternal( | 84 bool DigestInternal( |
86 const WebKit::WebCryptoAlgorithm& algorithm, | 85 const WebKit::WebCryptoAlgorithm& algorithm, |
87 const unsigned char* data, | 86 const unsigned char* data, |
88 unsigned data_size, | 87 unsigned data_size, |
89 WebKit::WebArrayBuffer* buffer); | 88 WebKit::WebArrayBuffer* buffer); |
90 bool GenerateKeyInternal( | 89 bool GenerateKeyInternal( |
91 const WebKit::WebCryptoAlgorithm& algorithm, | 90 const WebKit::WebCryptoAlgorithm& algorithm, |
92 scoped_ptr<WebKit::WebCryptoKeyHandle>* key, | 91 bool extractable, |
93 WebKit::WebCryptoKeyType* type); | 92 WebKit::WebCryptoKeyUsageMask usage_mask, |
| 93 WebKit::WebCryptoKey* key); |
94 bool ImportKeyInternal( | 94 bool ImportKeyInternal( |
95 WebKit::WebCryptoKeyFormat format, | 95 WebKit::WebCryptoKeyFormat format, |
96 const unsigned char* key_data, | 96 const unsigned char* key_data, |
97 unsigned key_data_size, | 97 unsigned key_data_size, |
98 const WebKit::WebCryptoAlgorithm& algorithm, | 98 const WebKit::WebCryptoAlgorithm& algorithm_or_null, |
| 99 bool extractable, |
99 WebKit::WebCryptoKeyUsageMask usage_mask, | 100 WebKit::WebCryptoKeyUsageMask usage_mask, |
100 scoped_ptr<WebKit::WebCryptoKeyHandle>* handle, | 101 WebKit::WebCryptoKey* key); |
101 WebKit::WebCryptoKeyType* type); | |
102 bool SignInternal( | 102 bool SignInternal( |
103 const WebKit::WebCryptoAlgorithm& algorithm, | 103 const WebKit::WebCryptoAlgorithm& algorithm, |
104 const WebKit::WebCryptoKey& key, | 104 const WebKit::WebCryptoKey& key, |
105 const unsigned char* data, | 105 const unsigned char* data, |
106 unsigned data_size, | 106 unsigned data_size, |
107 WebKit::WebArrayBuffer* buffer); | 107 WebKit::WebArrayBuffer* buffer); |
108 bool VerifySignatureInternal( | 108 bool VerifySignatureInternal( |
109 const WebKit::WebCryptoAlgorithm& algorithm, | 109 const WebKit::WebCryptoAlgorithm& algorithm, |
110 const WebKit::WebCryptoKey& key, | 110 const WebKit::WebCryptoKey& key, |
111 const unsigned char* signature, | 111 const unsigned char* signature, |
112 unsigned signature_size, | 112 unsigned signature_size, |
113 const unsigned char* data, | 113 const unsigned char* data, |
114 unsigned data_size, | 114 unsigned data_size, |
115 bool* signature_match); | 115 bool* signature_match); |
116 | 116 |
117 private: | 117 private: |
118 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); | 118 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); |
119 }; | 119 }; |
120 | 120 |
121 } // namespace content | 121 } // namespace content |
122 | 122 |
123 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ | 123 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ |
OLD | NEW |