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 "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 "third_party/WebKit/public/platform/WebArrayBuffer.h" | 11 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" |
11 #include "third_party/WebKit/public/platform/WebCrypto.h" | 12 #include "third_party/WebKit/public/platform/WebCrypto.h" |
12 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 13 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 enum EncryptOrDecrypt { ENCRYPT, DECRYPT }; | 17 enum EncryptOrDecrypt { ENCRYPT, DECRYPT }; |
17 | 18 |
18 namespace webcrypto { | 19 namespace webcrypto { |
19 | 20 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 const CryptoData& data, | 86 const CryptoData& data, |
86 blink::WebArrayBuffer* buffer); | 87 blink::WebArrayBuffer* buffer); |
87 | 88 |
88 // Preconditions: | 89 // Preconditions: |
89 // * |algorithm| is a SHA function. | 90 // * |algorithm| is a SHA function. |
90 Status DigestSha(blink::WebCryptoAlgorithmId algorithm, | 91 Status DigestSha(blink::WebCryptoAlgorithmId algorithm, |
91 const CryptoData& data, | 92 const CryptoData& data, |
92 blink::WebArrayBuffer* buffer); | 93 blink::WebArrayBuffer* buffer); |
93 | 94 |
94 // Preconditions: | 95 // Preconditions: |
| 96 // * |algorithm| is a SHA function. |
| 97 scoped_ptr<blink::WebCryptoDigestor> CreateDigestor( |
| 98 blink::WebCryptoAlgorithmId algorithm); |
| 99 |
| 100 // Preconditions: |
95 // * |key| is non-null. | 101 // * |key| is non-null. |
96 // * |hash| is a digest algorithm. | 102 // * |hash| is a digest algorithm. |
97 Status SignRsaSsaPkcs1v1_5(PrivateKey* key, | 103 Status SignRsaSsaPkcs1v1_5(PrivateKey* key, |
98 const blink::WebCryptoAlgorithm& hash, | 104 const blink::WebCryptoAlgorithm& hash, |
99 const CryptoData& data, | 105 const CryptoData& data, |
100 blink::WebArrayBuffer* buffer); | 106 blink::WebArrayBuffer* buffer); |
101 | 107 |
102 // Preconditions: | 108 // Preconditions: |
103 // * |key| is non-null. | 109 // * |key| is non-null. |
104 // * |hash| is a digest algorithm. | 110 // * |hash| is a digest algorithm. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 blink::WebCryptoKeyUsageMask usage_mask, | 240 blink::WebCryptoKeyUsageMask usage_mask, |
235 blink::WebCryptoKey* key); | 241 blink::WebCryptoKey* key); |
236 | 242 |
237 } // namespace platform | 243 } // namespace platform |
238 | 244 |
239 } // namespace webcrypto | 245 } // namespace webcrypto |
240 | 246 |
241 } // namespace content | 247 } // namespace content |
242 | 248 |
243 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 249 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
OLD | NEW |