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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // On success it is guaranteed that: | 74 // On success it is guaranteed that: |
75 // * public_exponent is either 3 or 65537 | 75 // * public_exponent is either 3 or 65537 |
76 // * modulus_length_bits is a multiple of 8 | 76 // * modulus_length_bits is a multiple of 8 |
77 // * modulus_length is >= 256 | 77 // * modulus_length is >= 256 |
78 // * modulus_length is <= 16K | 78 // * modulus_length is <= 16K |
79 Status GetRsaKeyGenParameters( | 79 Status GetRsaKeyGenParameters( |
80 const blink::WebCryptoRsaHashedKeyGenParams* params, | 80 const blink::WebCryptoRsaHashedKeyGenParams* params, |
81 unsigned int* public_exponent, | 81 unsigned int* public_exponent, |
82 unsigned int* modulus_length_bits); | 82 unsigned int* modulus_length_bits); |
83 | 83 |
| 84 // Splits the combined usages given to GenerateKey() into the respective usages |
| 85 // for the public key and private key. Returns an error if the usages are |
| 86 // invalid. |
| 87 Status GetUsagesForGenerateAsymmetricKey( |
| 88 blink::WebCryptoKeyUsageMask combined_usages, |
| 89 blink::WebCryptoKeyUsageMask all_public_usages, |
| 90 blink::WebCryptoKeyUsageMask all_private_usages, |
| 91 blink::WebCryptoKeyUsageMask* public_usages, |
| 92 blink::WebCryptoKeyUsageMask* private_usages); |
| 93 |
84 } // namespace webcrypto | 94 } // namespace webcrypto |
85 | 95 |
86 } // namespace content | 96 } // namespace content |
87 | 97 |
88 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 98 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
OLD | NEW |