OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
6 #define CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 6 #define CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" |
11 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" | 12 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" |
12 #include "third_party/WebKit/public/platform/WebCrypto.h" | 13 #include "third_party/WebKit/public/platform/WebCrypto.h" |
13 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 14 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 | 17 |
17 enum EncryptOrDecrypt { ENCRYPT, DECRYPT }; | 18 enum EncryptOrDecrypt { ENCRYPT, DECRYPT }; |
18 | 19 |
19 namespace webcrypto { | 20 namespace webcrypto { |
20 | 21 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 const CryptoData& data, | 87 const CryptoData& data, |
87 blink::WebArrayBuffer* buffer); | 88 blink::WebArrayBuffer* buffer); |
88 | 89 |
89 // Preconditions: | 90 // Preconditions: |
90 // * |algorithm| is a SHA function. | 91 // * |algorithm| is a SHA function. |
91 Status DigestSha(blink::WebCryptoAlgorithmId algorithm, | 92 Status DigestSha(blink::WebCryptoAlgorithmId algorithm, |
92 const CryptoData& data, | 93 const CryptoData& data, |
93 blink::WebArrayBuffer* buffer); | 94 blink::WebArrayBuffer* buffer); |
94 | 95 |
95 // Preconditions: | 96 // Preconditions: |
| 97 // * |algorithm| is a SHA function. |
| 98 scoped_ptr<blink::WebCryptoDigestor> CreateDigestor( |
| 99 blink::WebCryptoAlgorithmId algorithm); |
| 100 |
| 101 // Preconditions: |
96 // * |key| is non-null. | 102 // * |key| is non-null. |
97 // * |hash| is a digest algorithm. | 103 // * |hash| is a digest algorithm. |
98 Status SignRsaSsaPkcs1v1_5(PrivateKey* key, | 104 Status SignRsaSsaPkcs1v1_5(PrivateKey* key, |
99 const blink::WebCryptoAlgorithm& hash, | 105 const blink::WebCryptoAlgorithm& hash, |
100 const CryptoData& data, | 106 const CryptoData& data, |
101 blink::WebArrayBuffer* buffer); | 107 blink::WebArrayBuffer* buffer); |
102 | 108 |
103 // Preconditions: | 109 // Preconditions: |
104 // * |key| is non-null. | 110 // * |key| is non-null. |
105 // * |hash| is a digest algorithm. | 111 // * |hash| is a digest algorithm. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 blink::WebCryptoKeyUsageMask usage_mask, | 247 blink::WebCryptoKeyUsageMask usage_mask, |
242 blink::WebCryptoKey* key); | 248 blink::WebCryptoKey* key); |
243 | 249 |
244 } // namespace platform | 250 } // namespace platform |
245 | 251 |
246 } // namespace webcrypto | 252 } // namespace webcrypto |
247 | 253 |
248 } // namespace content | 254 } // namespace content |
249 | 255 |
250 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 256 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
OLD | NEW |