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_UTIL_H_ | 5 #ifndef CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
6 #define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 6 #define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 27 matching lines...) Expand all Loading... |
38 // Returns the "hash" param for an algorithm if it exists, otherwise returns | 38 // Returns the "hash" param for an algorithm if it exists, otherwise returns |
39 // a null algorithm. | 39 // a null algorithm. |
40 blink::WebCryptoAlgorithm GetInnerHashAlgorithm( | 40 blink::WebCryptoAlgorithm GetInnerHashAlgorithm( |
41 const blink::WebCryptoAlgorithm& algorithm); | 41 const blink::WebCryptoAlgorithm& algorithm); |
42 | 42 |
43 // Creates a WebCryptoAlgorithm without any parameters. | 43 // Creates a WebCryptoAlgorithm without any parameters. |
44 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateAlgorithm( | 44 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateAlgorithm( |
45 blink::WebCryptoAlgorithmId id); | 45 blink::WebCryptoAlgorithmId id); |
46 | 46 |
47 // Creates an HMAC algorithm whose inner hash algorithm is determined by the | 47 // Creates an HMAC algorithm whose inner hash algorithm is determined by the |
48 // specified hash output length. It is an error to call this method with an | |
49 // unsupported hash output length. | |
50 blink::WebCryptoAlgorithm CreateHmacAlgorithmByHashOutputLen( | |
51 unsigned short hash_output_length_bits); | |
52 | |
53 // Creates an HMAC algorithm whose inner hash algorithm is determined by the | |
54 // specified algorithm ID. It is an error to call this method with a hash | 48 // specified algorithm ID. It is an error to call this method with a hash |
55 // algorithm that is not SHA*. | 49 // algorithm that is not SHA*. |
56 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateHmacAlgorithmByHashId( | 50 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateHmacAlgorithmByHashId( |
57 blink::WebCryptoAlgorithmId hash_id); | 51 blink::WebCryptoAlgorithmId hash_id); |
58 | 52 |
59 // Creates an HMAC algorithm whose parameters struct is compatible with key | 53 // Creates an HMAC algorithm whose parameters struct is compatible with key |
60 // generation. It is an error to call this with a hash_id that is not a SHA*. | 54 // generation. It is an error to call this with a hash_id that is not a SHA*. |
61 // The key_length_bytes parameter is optional, with zero meaning unspecified. | 55 // The key_length_bytes parameter is optional, with zero meaning unspecified. |
62 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateHmacKeyGenAlgorithm( | 56 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateHmacKeyGenAlgorithm( |
63 blink::WebCryptoAlgorithmId hash_id, | 57 blink::WebCryptoAlgorithmId hash_id, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // Creates an AES-GCM algorithm whose parameters struct is compatible with key | 92 // Creates an AES-GCM algorithm whose parameters struct is compatible with key |
99 // generation. | 93 // generation. |
100 blink::WebCryptoAlgorithm CreateAesGcmKeyGenAlgorithm( | 94 blink::WebCryptoAlgorithm CreateAesGcmKeyGenAlgorithm( |
101 unsigned short key_length_bits); | 95 unsigned short key_length_bits); |
102 | 96 |
103 } // namespace webcrypto | 97 } // namespace webcrypto |
104 | 98 |
105 } // namespace content | 99 } // namespace content |
106 | 100 |
107 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 101 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
OLD | NEW |