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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 unsigned int* keylen_bits); | 80 unsigned int* keylen_bits); |
81 | 81 |
82 Status GetHmacKeyGenLengthInBits(const blink::WebCryptoHmacKeyGenParams* params, | 82 Status GetHmacKeyGenLengthInBits(const blink::WebCryptoHmacKeyGenParams* params, |
83 unsigned int* keylen_bits); | 83 unsigned int* keylen_bits); |
84 | 84 |
85 Status VerifyAesKeyLengthForImport(unsigned int keylen_bytes); | 85 Status VerifyAesKeyLengthForImport(unsigned int keylen_bytes); |
86 | 86 |
87 Status CheckKeyCreationUsages(blink::WebCryptoKeyUsageMask all_possible_usages, | 87 Status CheckKeyCreationUsages(blink::WebCryptoKeyUsageMask all_possible_usages, |
88 blink::WebCryptoKeyUsageMask actual_usages); | 88 blink::WebCryptoKeyUsageMask actual_usages); |
89 | 89 |
| 90 // Extracts the public exponent and modulus length from the Blink parameters. |
| 91 // On success it is guaranteed that: |
| 92 // * public_exponent is either 3 or 65537 |
| 93 // * modulus_length_bits is a multiple of 8 |
| 94 // * modulus_length is >= 256 |
| 95 // * modulus_length is <= 16K |
| 96 Status GetRsaKeyGenParameters( |
| 97 const blink::WebCryptoRsaHashedKeyGenParams* params, |
| 98 unsigned int* public_exponent, |
| 99 unsigned int* modulus_length_bits); |
| 100 |
90 } // namespace webcrypto | 101 } // namespace webcrypto |
91 | 102 |
92 } // namespace content | 103 } // namespace content |
93 | 104 |
94 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 105 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
OLD | NEW |