| 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); | |
| 33 virtual void digest( | 27 virtual void digest( |
| 34 const WebKit::WebCryptoAlgorithm& algorithm, | 28 const WebKit::WebCryptoAlgorithm& algorithm, |
| 35 const unsigned char* data, | 29 const unsigned char* data, |
| 36 unsigned data_size, | 30 unsigned data_size, |
| 37 WebKit::WebCryptoResult result); | 31 WebKit::WebCryptoResult result); |
| 38 virtual void importKey( | 32 virtual void importKey( |
| 39 WebKit::WebCryptoKeyFormat format, | 33 WebKit::WebCryptoKeyFormat format, |
| 40 const unsigned char* key_data, | 34 const unsigned char* key_data, |
| 41 unsigned key_data_size, | 35 unsigned key_data_size, |
| 42 const WebKit::WebCryptoAlgorithm& algorithm, | 36 const WebKit::WebCryptoAlgorithm& algorithm, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 friend class WebCryptoImplTest; | 56 friend class WebCryptoImplTest; |
| 63 | 57 |
| 64 void Init(); | 58 void Init(); |
| 65 | 59 |
| 66 bool EncryptInternal( | 60 bool EncryptInternal( |
| 67 const WebKit::WebCryptoAlgorithm& algorithm, | 61 const WebKit::WebCryptoAlgorithm& algorithm, |
| 68 const WebKit::WebCryptoKey& key, | 62 const WebKit::WebCryptoKey& key, |
| 69 const unsigned char* data, | 63 const unsigned char* data, |
| 70 unsigned data_size, | 64 unsigned data_size, |
| 71 WebKit::WebArrayBuffer* buffer); | 65 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); | |
| 78 bool DigestInternal( | 66 bool DigestInternal( |
| 79 const WebKit::WebCryptoAlgorithm& algorithm, | 67 const WebKit::WebCryptoAlgorithm& algorithm, |
| 80 const unsigned char* data, | 68 const unsigned char* data, |
| 81 unsigned data_size, | 69 unsigned data_size, |
| 82 WebKit::WebArrayBuffer* buffer); | 70 WebKit::WebArrayBuffer* buffer); |
| 83 bool ImportKeyInternal( | 71 bool ImportKeyInternal( |
| 84 WebKit::WebCryptoKeyFormat format, | 72 WebKit::WebCryptoKeyFormat format, |
| 85 const unsigned char* key_data, | 73 const unsigned char* key_data, |
| 86 unsigned key_data_size, | 74 unsigned key_data_size, |
| 87 const WebKit::WebCryptoAlgorithm& algorithm, | 75 const WebKit::WebCryptoAlgorithm& algorithm, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 103 unsigned data_size, | 91 unsigned data_size, |
| 104 bool* signature_match); | 92 bool* signature_match); |
| 105 | 93 |
| 106 private: | 94 private: |
| 107 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); | 95 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); |
| 108 }; | 96 }; |
| 109 | 97 |
| 110 } // namespace content | 98 } // namespace content |
| 111 | 99 |
| 112 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ | 100 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ |
| OLD | NEW |