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 "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 blink::WebCryptoResult result); | 55 blink::WebCryptoResult result); |
56 virtual void verifySignature( | 56 virtual void verifySignature( |
57 const blink::WebCryptoAlgorithm& algorithm, | 57 const blink::WebCryptoAlgorithm& algorithm, |
58 const blink::WebCryptoKey& key, | 58 const blink::WebCryptoKey& key, |
59 const unsigned char* signature, | 59 const unsigned char* signature, |
60 unsigned signature_size, | 60 unsigned signature_size, |
61 const unsigned char* data, | 61 const unsigned char* data, |
62 unsigned data_size, | 62 unsigned data_size, |
63 blink::WebCryptoResult result); | 63 blink::WebCryptoResult result); |
64 | 64 |
65 static void ShrinkBuffer(blink::WebArrayBuffer* buffer, unsigned new_size); | |
66 | 65 |
67 protected: | 66 protected: |
68 friend class WebCryptoImplTest; | 67 friend class WebCryptoImplTest; |
69 | 68 |
70 void Init(); | 69 void Init(); |
71 | 70 |
72 bool EncryptInternal( | 71 bool EncryptInternal( |
73 const blink::WebCryptoAlgorithm& algorithm, | 72 const blink::WebCryptoAlgorithm& algorithm, |
74 const blink::WebCryptoKey& key, | 73 const blink::WebCryptoKey& key, |
75 const unsigned char* data, | 74 const unsigned char* data, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 blink::WebArrayBuffer* buffer); | 112 blink::WebArrayBuffer* buffer); |
114 bool VerifySignatureInternal( | 113 bool VerifySignatureInternal( |
115 const blink::WebCryptoAlgorithm& algorithm, | 114 const blink::WebCryptoAlgorithm& algorithm, |
116 const blink::WebCryptoKey& key, | 115 const blink::WebCryptoKey& key, |
117 const unsigned char* signature, | 116 const unsigned char* signature, |
118 unsigned signature_size, | 117 unsigned signature_size, |
119 const unsigned char* data, | 118 const unsigned char* data, |
120 unsigned data_size, | 119 unsigned data_size, |
121 bool* signature_match); | 120 bool* signature_match); |
122 | 121 |
| 122 bool ImportKeyJwk( |
| 123 const unsigned char* key_data, |
| 124 unsigned key_data_size, |
| 125 const blink::WebCryptoAlgorithm& algorithm_or_null, |
| 126 bool extractable, |
| 127 blink::WebCryptoKeyUsageMask usage_mask, |
| 128 blink::WebCryptoKey* key); |
| 129 |
123 private: | 130 private: |
124 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); | 131 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); |
125 }; | 132 }; |
126 | 133 |
127 } // namespace content | 134 } // namespace content |
128 | 135 |
129 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ | 136 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ |
OLD | NEW |