| 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" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "third_party/WebKit/public/platform/WebCrypto.h" | 12 #include "third_party/WebKit/public/platform/WebCrypto.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 class CONTENT_EXPORT WebCryptoImpl | 16 class CONTENT_EXPORT WebCryptoImpl |
| 17 : NON_EXPORTED_BASE(public WebKit::WebCrypto) { | 17 : NON_EXPORTED_BASE(public WebKit::WebCrypto) { |
| 18 public: | 18 public: |
| 19 WebCryptoImpl(); | 19 WebCryptoImpl(); |
| 20 | 20 |
| 21 virtual void encrypt( | 21 virtual void encrypt( |
| 22 const WebKit::WebCryptoAlgorithm& algorithm, | 22 const WebKit::WebCryptoAlgorithm& algorithm, |
| 23 const WebKit::WebCryptoKey& key, | 23 const WebKit::WebCryptoKey& key, |
| 24 const unsigned char* data, | 24 const unsigned char* data, |
| 25 unsigned data_size, | 25 unsigned data_size, |
| 26 WebKit::WebCryptoResult result); | 26 WebKit::WebCryptoResult result); |
| 27 virtual void decrypt( |
| 28 const WebKit::WebCryptoAlgorithm& algorithm, |
| 29 const WebKit::WebCryptoKey& key, |
| 30 const unsigned char* data, |
| 31 unsigned data_size, |
| 32 WebKit::WebCryptoResult result); |
| 27 virtual void digest( | 33 virtual void digest( |
| 28 const WebKit::WebCryptoAlgorithm& algorithm, | 34 const WebKit::WebCryptoAlgorithm& algorithm, |
| 29 const unsigned char* data, | 35 const unsigned char* data, |
| 30 unsigned data_size, | 36 unsigned data_size, |
| 31 WebKit::WebCryptoResult result); | 37 WebKit::WebCryptoResult result); |
| 32 virtual void importKey( | 38 virtual void importKey( |
| 33 WebKit::WebCryptoKeyFormat format, | 39 WebKit::WebCryptoKeyFormat format, |
| 34 const unsigned char* key_data, | 40 const unsigned char* key_data, |
| 35 unsigned key_data_size, | 41 unsigned key_data_size, |
| 36 const WebKit::WebCryptoAlgorithm& algorithm, | 42 const WebKit::WebCryptoAlgorithm& algorithm, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 56 friend class WebCryptoImplTest; | 62 friend class WebCryptoImplTest; |
| 57 | 63 |
| 58 void Init(); | 64 void Init(); |
| 59 | 65 |
| 60 bool EncryptInternal( | 66 bool EncryptInternal( |
| 61 const WebKit::WebCryptoAlgorithm& algorithm, | 67 const WebKit::WebCryptoAlgorithm& algorithm, |
| 62 const WebKit::WebCryptoKey& key, | 68 const WebKit::WebCryptoKey& key, |
| 63 const unsigned char* data, | 69 const unsigned char* data, |
| 64 unsigned data_size, | 70 unsigned data_size, |
| 65 WebKit::WebArrayBuffer* buffer); | 71 WebKit::WebArrayBuffer* buffer); |
| 72 bool DecryptInternal( |
| 73 const WebKit::WebCryptoAlgorithm& algorithm, |
| 74 const WebKit::WebCryptoKey& key, |
| 75 const unsigned char* data, |
| 76 unsigned data_size, |
| 77 WebKit::WebArrayBuffer* buffer); |
| 66 bool DigestInternal( | 78 bool DigestInternal( |
| 67 const WebKit::WebCryptoAlgorithm& algorithm, | 79 const WebKit::WebCryptoAlgorithm& algorithm, |
| 68 const unsigned char* data, | 80 const unsigned char* data, |
| 69 unsigned data_size, | 81 unsigned data_size, |
| 70 WebKit::WebArrayBuffer* buffer); | 82 WebKit::WebArrayBuffer* buffer); |
| 71 bool ImportKeyInternal( | 83 bool ImportKeyInternal( |
| 72 WebKit::WebCryptoKeyFormat format, | 84 WebKit::WebCryptoKeyFormat format, |
| 73 const unsigned char* key_data, | 85 const unsigned char* key_data, |
| 74 unsigned key_data_size, | 86 unsigned key_data_size, |
| 75 const WebKit::WebCryptoAlgorithm& algorithm, | 87 const WebKit::WebCryptoAlgorithm& algorithm, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 91 unsigned data_size, | 103 unsigned data_size, |
| 92 bool* signature_match); | 104 bool* signature_match); |
| 93 | 105 |
| 94 private: | 106 private: |
| 95 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); | 107 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); |
| 96 }; | 108 }; |
| 97 | 109 |
| 98 } // namespace content | 110 } // namespace content |
| 99 | 111 |
| 100 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ | 112 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ |
| OLD | NEW |