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

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

Issue 786363002: Refactor: Extract common code for generating asymmetric keys to a helper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again sigh 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // The "get key length" operation for AES keys. 123 // The "get key length" operation for AES keys.
124 Status GetAesKeyLength(const blink::WebCryptoAlgorithm& key_length_algorithm, 124 Status GetAesKeyLength(const blink::WebCryptoAlgorithm& key_length_algorithm,
125 bool* has_length_bits, 125 bool* has_length_bits,
126 unsigned int* length_bits); 126 unsigned int* length_bits);
127 127
128 // The "get key length" operation for HMAC keys. 128 // The "get key length" operation for HMAC keys.
129 Status GetHmacKeyLength(const blink::WebCryptoAlgorithm& key_length_algorithm, 129 Status GetHmacKeyLength(const blink::WebCryptoAlgorithm& key_length_algorithm,
130 bool* has_length_bits, 130 bool* has_length_bits,
131 unsigned int* length_bits); 131 unsigned int* length_bits);
132 132
133 // Splits the combined usages given to GenerateKey() into the respective usages
134 // for the public key and private key. Returns an error if the usages are
135 // invalid.
136 Status GetUsagesForGenerateAsymmetricKey(
137 blink::WebCryptoKeyUsageMask combined_usages,
138 blink::WebCryptoKeyUsageMask all_public_usages,
139 blink::WebCryptoKeyUsageMask all_private_usages,
140 blink::WebCryptoKeyUsageMask* public_usages,
141 blink::WebCryptoKeyUsageMask* private_usages);
142
133 } // namespace webcrypto 143 } // namespace webcrypto
134 144
135 } // namespace content 145 } // namespace content
136 146
137 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 147 #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