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