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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 blink::WebCryptoResult result); | 59 blink::WebCryptoResult result); |
60 virtual void verifySignature( | 60 virtual void verifySignature( |
61 const blink::WebCryptoAlgorithm& algorithm, | 61 const blink::WebCryptoAlgorithm& algorithm, |
62 const blink::WebCryptoKey& key, | 62 const blink::WebCryptoKey& key, |
63 const unsigned char* signature, | 63 const unsigned char* signature, |
64 unsigned signature_size, | 64 unsigned signature_size, |
65 const unsigned char* data, | 65 const unsigned char* data, |
66 unsigned data_size, | 66 unsigned data_size, |
67 blink::WebCryptoResult result); | 67 blink::WebCryptoResult result); |
68 | 68 |
69 static void ShrinkBuffer(blink::WebArrayBuffer* buffer, unsigned new_size); | |
70 | 69 |
71 protected: | 70 protected: |
72 friend class WebCryptoImplTest; | 71 friend class WebCryptoImplTest; |
73 | 72 |
74 void Init(); | 73 void Init(); |
75 | 74 |
76 bool EncryptInternal( | 75 bool EncryptInternal( |
77 const blink::WebCryptoAlgorithm& algorithm, | 76 const blink::WebCryptoAlgorithm& algorithm, |
78 const blink::WebCryptoKey& key, | 77 const blink::WebCryptoKey& key, |
79 const unsigned char* data, | 78 const unsigned char* data, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 blink::WebArrayBuffer* buffer); | 120 blink::WebArrayBuffer* buffer); |
122 bool VerifySignatureInternal( | 121 bool VerifySignatureInternal( |
123 const blink::WebCryptoAlgorithm& algorithm, | 122 const blink::WebCryptoAlgorithm& algorithm, |
124 const blink::WebCryptoKey& key, | 123 const blink::WebCryptoKey& key, |
125 const unsigned char* signature, | 124 const unsigned char* signature, |
126 unsigned signature_size, | 125 unsigned signature_size, |
127 const unsigned char* data, | 126 const unsigned char* data, |
128 unsigned data_size, | 127 unsigned data_size, |
129 bool* signature_match); | 128 bool* signature_match); |
130 | 129 |
| 130 bool ImportKeyJwk( |
| 131 const unsigned char* key_data, |
| 132 unsigned key_data_size, |
| 133 const blink::WebCryptoAlgorithm& algorithm_or_null, |
| 134 bool extractable, |
| 135 blink::WebCryptoKeyUsageMask usage_mask, |
| 136 blink::WebCryptoKey* key); |
| 137 |
131 private: | 138 private: |
132 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); | 139 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); |
133 }; | 140 }; |
134 | 141 |
135 } // namespace content | 142 } // namespace content |
136 | 143 |
137 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ | 144 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ |
OLD | NEW |