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_WEBCRYPTO_UTIL_H_ | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
6 #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 6 #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h" | 13 #include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h" |
14 #include "third_party/WebKit/public/platform/WebCryptoKey.h" | 14 #include "third_party/WebKit/public/platform/WebCryptoKey.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 namespace webcrypto { | 18 namespace webcrypto { |
19 | 19 |
20 class Status; | 20 class Status; |
21 | 21 |
22 // Composes a Web Crypto usage mask from an array of JWK key_ops values. | 22 // Converts a JWK "key_ops" array to the corresponding WebCrypto usages. |
23 CONTENT_EXPORT Status GetWebCryptoUsagesFromJwkKeyOps( | 23 CONTENT_EXPORT Status |
24 const base::ListValue* jwk_key_ops_value, | 24 GetWebCryptoUsagesFromJwkKeyOps(const base::ListValue* key_ops, |
25 blink::WebCryptoKeyUsageMask* jwk_key_ops_mask); | 25 blink::WebCryptoKeyUsageMask* usages); |
26 | 26 |
27 // Composes a JWK key_ops array from a Web Crypto usage mask. | 27 // Composes a JWK key_ops array from a Web Crypto usage mask. |
28 base::ListValue* CreateJwkKeyOpsFromWebCryptoUsages( | 28 base::ListValue* CreateJwkKeyOpsFromWebCryptoUsages( |
29 blink::WebCryptoKeyUsageMask usages); | 29 blink::WebCryptoKeyUsageMask usages); |
30 | 30 |
31 // Creates a WebCryptoAlgorithm without any parameters. | 31 // Creates a WebCryptoAlgorithm without any parameters. |
32 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateAlgorithm( | 32 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateAlgorithm( |
33 blink::WebCryptoAlgorithmId id); | 33 blink::WebCryptoAlgorithmId id); |
34 | 34 |
35 // Creates an HMAC import algorithm whose inner hash algorithm is determined by | 35 // Creates an HMAC import algorithm whose inner hash algorithm is determined by |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 Status GetRsaKeyGenParameters( | 74 Status GetRsaKeyGenParameters( |
75 const blink::WebCryptoRsaHashedKeyGenParams* params, | 75 const blink::WebCryptoRsaHashedKeyGenParams* params, |
76 unsigned int* public_exponent, | 76 unsigned int* public_exponent, |
77 unsigned int* modulus_length_bits); | 77 unsigned int* modulus_length_bits); |
78 | 78 |
79 } // namespace webcrypto | 79 } // namespace webcrypto |
80 | 80 |
81 } // namespace content | 81 } // namespace content |
82 | 82 |
83 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 83 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
OLD | NEW |