Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: content/child/webcrypto/webcrypto_util.h

Issue 787123003: Refactor: Extract some duplicated code for verifying usages during import of asymmetric key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Verifies that |usages| is valid when importing a key of the given format.
85 Status VerifyUsagesBeforeImportAsymmetricKey(
86 blink::WebCryptoKeyFormat format,
87 blink::WebCryptoKeyUsageMask all_public_key_usages,
88 blink::WebCryptoKeyUsageMask all_private_key_usages,
89 blink::WebCryptoKeyUsageMask usages);
90
84 } // namespace webcrypto 91 } // namespace webcrypto
85 92
86 } // namespace content 93 } // namespace content
87 94
88 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 95 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_
OLDNEW
« no previous file with comments | « content/child/webcrypto/openssl/rsa_key_openssl.cc ('k') | content/child/webcrypto/webcrypto_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698