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 #include <vector> | 10 #include <vector> |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 // Composes a Web Crypto usage mask from an array of JWK key_ops values. | 36 // Composes a Web Crypto usage mask from an array of JWK key_ops values. |
37 CONTENT_EXPORT Status GetWebCryptoUsagesFromJwkKeyOps( | 37 CONTENT_EXPORT Status GetWebCryptoUsagesFromJwkKeyOps( |
38 const base::ListValue* jwk_key_ops_value, | 38 const base::ListValue* jwk_key_ops_value, |
39 blink::WebCryptoKeyUsageMask* jwk_key_ops_mask); | 39 blink::WebCryptoKeyUsageMask* jwk_key_ops_mask); |
40 | 40 |
41 // Composes a JWK key_ops array from a Web Crypto usage mask. | 41 // Composes a JWK key_ops array from a Web Crypto usage mask. |
42 base::ListValue* CreateJwkKeyOpsFromWebCryptoUsages( | 42 base::ListValue* CreateJwkKeyOpsFromWebCryptoUsages( |
43 blink::WebCryptoKeyUsageMask usage_mask); | 43 blink::WebCryptoKeyUsageMask usage_mask); |
44 | 44 |
45 // Returns the "hash" param for an algorithm if it exists, otherwise returns | |
46 // a null algorithm. | |
47 blink::WebCryptoAlgorithm GetInnerHashAlgorithm( | |
48 const blink::WebCryptoAlgorithm& algorithm); | |
49 | |
50 // Creates a WebCryptoAlgorithm without any parameters. | 45 // Creates a WebCryptoAlgorithm without any parameters. |
51 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateAlgorithm( | 46 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateAlgorithm( |
52 blink::WebCryptoAlgorithmId id); | 47 blink::WebCryptoAlgorithmId id); |
53 | 48 |
54 // Creates an HMAC import algorithm whose inner hash algorithm is determined by | 49 // Creates an HMAC import algorithm whose inner hash algorithm is determined by |
55 // the specified algorithm ID. It is an error to call this method with a hash | 50 // the specified algorithm ID. It is an error to call this method with a hash |
56 // algorithm that is not SHA*. | 51 // algorithm that is not SHA*. |
57 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateHmacImportAlgorithm( | 52 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateHmacImportAlgorithm( |
58 blink::WebCryptoAlgorithmId hash_id); | 53 blink::WebCryptoAlgorithmId hash_id); |
59 | 54 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 Status GetRsaKeyGenParameters( | 91 Status GetRsaKeyGenParameters( |
97 const blink::WebCryptoRsaHashedKeyGenParams* params, | 92 const blink::WebCryptoRsaHashedKeyGenParams* params, |
98 unsigned int* public_exponent, | 93 unsigned int* public_exponent, |
99 unsigned int* modulus_length_bits); | 94 unsigned int* modulus_length_bits); |
100 | 95 |
101 } // namespace webcrypto | 96 } // namespace webcrypto |
102 | 97 |
103 } // namespace content | 98 } // namespace content |
104 | 99 |
105 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 100 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
OLD | NEW |