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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 | 61 |
62 Status GetAesKeyGenLengthInBits(const blink::WebCryptoAesKeyGenParams* params, | 62 Status GetAesKeyGenLengthInBits(const blink::WebCryptoAesKeyGenParams* params, |
63 unsigned int* keylen_bits); | 63 unsigned int* keylen_bits); |
64 | 64 |
65 Status GetHmacKeyGenLengthInBits(const blink::WebCryptoHmacKeyGenParams* params, | 65 Status GetHmacKeyGenLengthInBits(const blink::WebCryptoHmacKeyGenParams* params, |
66 unsigned int* keylen_bits); | 66 unsigned int* keylen_bits); |
67 | 67 |
68 Status VerifyAesKeyLengthForImport(unsigned int keylen_bytes); | 68 Status VerifyAesKeyLengthForImport(unsigned int keylen_bytes); |
69 | 69 |
70 Status CheckKeyCreationUsages(blink::WebCryptoKeyUsageMask all_possible_usages, | 70 Status CheckKeyCreationUsages(blink::WebCryptoKeyUsageMask all_possible_usages, |
71 blink::WebCryptoKeyUsageMask actual_usages); | 71 blink::WebCryptoKeyUsageMask actual_usages, |
72 bool checkImportKeyEmptyUsage = false); | |
eroman
2014/12/09 17:42:55
The style forbids default parameters, and also thi
| |
72 | 73 |
73 // Extracts the public exponent and modulus length from the Blink parameters. | 74 // Extracts the public exponent and modulus length from the Blink parameters. |
74 // On success it is guaranteed that: | 75 // On success it is guaranteed that: |
75 // * public_exponent is either 3 or 65537 | 76 // * public_exponent is either 3 or 65537 |
76 // * modulus_length_bits is a multiple of 8 | 77 // * modulus_length_bits is a multiple of 8 |
77 // * modulus_length is >= 256 | 78 // * modulus_length is >= 256 |
78 // * modulus_length is <= 16K | 79 // * modulus_length is <= 16K |
79 Status GetRsaKeyGenParameters( | 80 Status GetRsaKeyGenParameters( |
80 const blink::WebCryptoRsaHashedKeyGenParams* params, | 81 const blink::WebCryptoRsaHashedKeyGenParams* params, |
81 unsigned int* public_exponent, | 82 unsigned int* public_exponent, |
82 unsigned int* modulus_length_bits); | 83 unsigned int* modulus_length_bits); |
83 | 84 |
84 } // namespace webcrypto | 85 } // namespace webcrypto |
85 | 86 |
86 } // namespace content | 87 } // namespace content |
87 | 88 |
88 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 89 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
OLD | NEW |