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 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // The "get key length" operation for AES keys. | 123 // The "get key length" operation for AES keys. |
124 Status GetAesKeyLength(const blink::WebCryptoAlgorithm& key_length_algorithm, | 124 Status GetAesKeyLength(const blink::WebCryptoAlgorithm& key_length_algorithm, |
125 bool* has_length_bits, | 125 bool* has_length_bits, |
126 unsigned int* length_bits); | 126 unsigned int* length_bits); |
127 | 127 |
128 // The "get key length" operation for HMAC keys. | 128 // The "get key length" operation for HMAC keys. |
129 Status GetHmacKeyLength(const blink::WebCryptoAlgorithm& key_length_algorithm, | 129 Status GetHmacKeyLength(const blink::WebCryptoAlgorithm& key_length_algorithm, |
130 bool* has_length_bits, | 130 bool* has_length_bits, |
131 unsigned int* length_bits); | 131 unsigned int* length_bits); |
132 | 132 |
| 133 // Splits the combined usages given to GenerateKey() into the respective usages |
| 134 // for the public key and private key. Returns an error if the usages are |
| 135 // invalid. |
| 136 Status GetUsagesForGenerateAsymmetricKey( |
| 137 blink::WebCryptoKeyUsageMask combined_usages, |
| 138 blink::WebCryptoKeyUsageMask all_public_usages, |
| 139 blink::WebCryptoKeyUsageMask all_private_usages, |
| 140 blink::WebCryptoKeyUsageMask* public_usages, |
| 141 blink::WebCryptoKeyUsageMask* private_usages); |
| 142 |
133 } // namespace webcrypto | 143 } // namespace webcrypto |
134 | 144 |
135 } // namespace content | 145 } // namespace content |
136 | 146 |
137 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 147 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
OLD | NEW |