| 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_PLATFORM_CRYPTO_H_ | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
| 6 #define CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 6 #define CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // Preconditions: | 160 // Preconditions: |
| 161 // * algorithm.id() is for an RSA algorithm. | 161 // * algorithm.id() is for an RSA algorithm. |
| 162 // * public_exponent, modulus_length_bits and hash_or_null are the same as what | 162 // * public_exponent, modulus_length_bits and hash_or_null are the same as what |
| 163 // is in algorithm. They are split out for convenience. | 163 // is in algorithm. They are split out for convenience. |
| 164 // * hash_or_null.isNull() may be true if a hash is not applicable to the | 164 // * hash_or_null.isNull() may be true if a hash is not applicable to the |
| 165 // algorithm | 165 // algorithm |
| 166 // * modulus_length_bits is not 0 | 166 // * modulus_length_bits is not 0 |
| 167 // * public_exponent is not empty. | 167 // * public_exponent is not empty. |
| 168 Status GenerateRsaKeyPair(const blink::WebCryptoAlgorithm& algorithm, | 168 Status GenerateRsaKeyPair(const blink::WebCryptoAlgorithm& algorithm, |
| 169 bool extractable, | 169 bool extractable, |
| 170 blink::WebCryptoKeyUsageMask usage_mask, | 170 blink::WebCryptoKeyUsageMask public_key_usage_mask, |
| 171 blink::WebCryptoKeyUsageMask private_key_usage_mask, |
| 171 unsigned int modulus_length_bits, | 172 unsigned int modulus_length_bits, |
| 172 const CryptoData& public_exponent, | 173 const CryptoData& public_exponent, |
| 173 const blink::WebCryptoAlgorithm& hash, | 174 const blink::WebCryptoAlgorithm& hash, |
| 174 blink::WebCryptoKey* public_key, | 175 blink::WebCryptoKey* public_key, |
| 175 blink::WebCryptoKey* private_key); | 176 blink::WebCryptoKey* private_key); |
| 176 | 177 |
| 177 // Preconditions: | 178 // Preconditions: |
| 178 // * |key| is non-null. | 179 // * |key| is non-null. |
| 179 // * |algorithm.id()| is for a symmetric key algorithm. | 180 // * |algorithm.id()| is for a symmetric key algorithm. |
| 180 // * For AES algorithms |key_data| is either 16, 24, or 32 bytes long. | 181 // * For AES algorithms |key_data| is either 16, 24, or 32 bytes long. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 blink::WebCryptoKeyUsageMask usage_mask, | 281 blink::WebCryptoKeyUsageMask usage_mask, |
| 281 blink::WebCryptoKey* key); | 282 blink::WebCryptoKey* key); |
| 282 | 283 |
| 283 } // namespace platform | 284 } // namespace platform |
| 284 | 285 |
| 285 } // namespace webcrypto | 286 } // namespace webcrypto |
| 286 | 287 |
| 287 } // namespace content | 288 } // namespace content |
| 288 | 289 |
| 289 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 290 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
| OLD | NEW |