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

Side by Side Diff: content/child/webcrypto/test/test_helpers.h

Issue 512023002: Refactor the interface for generating keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Run git-cl format Created 6 years, 2 months 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_TEST_TEST_HELPERS_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_TEST_TEST_HELPERS_H_
6 #define CONTENT_CHILD_WEBCRYPTO_TEST_TEST_HELPERS_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_TEST_TEST_HELPERS_H_
7 7
8 #include <ostream> 8 #include <ostream>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 const std::string& e_expected_hex, 163 const std::string& e_expected_hex,
164 blink::WebCryptoKeyUsageMask use_mask_expected); 164 blink::WebCryptoKeyUsageMask use_mask_expected);
165 165
166 // Helper that tests importing ane exporting of symmetric keys as JWK. 166 // Helper that tests importing ane exporting of symmetric keys as JWK.
167 void ImportExportJwkSymmetricKey( 167 void ImportExportJwkSymmetricKey(
168 int key_len_bits, 168 int key_len_bits,
169 const blink::WebCryptoAlgorithm& import_algorithm, 169 const blink::WebCryptoAlgorithm& import_algorithm,
170 blink::WebCryptoKeyUsageMask usages, 170 blink::WebCryptoKeyUsageMask usages,
171 const std::string& jwk_alg); 171 const std::string& jwk_alg);
172 172
173 // Wrappers around GenerateKey() which expect the result to be either a secret
174 // key or a public/private keypair. If the result does not match the
175 // expectation, then it fails with Status::ErrorUnexpected().
176 Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm,
177 bool extractable,
178 blink::WebCryptoKeyUsageMask usage_mask,
179 blink::WebCryptoKey* key);
180 Status GenerateKeyPair(const blink::WebCryptoAlgorithm& algorithm,
181 bool extractable,
182 blink::WebCryptoKeyUsageMask usage_mask,
183 blink::WebCryptoKey* public_key,
184 blink::WebCryptoKey* private_key);
185
173 } // namespace webcrypto 186 } // namespace webcrypto
174 187
175 } // namesapce content 188 } // namesapce content
176 189
177 #endif // CONTENT_CHILD_WEBCRYPTO_TEST_TEST_HELPERS_H_ 190 #endif // CONTENT_CHILD_WEBCRYPTO_TEST_TEST_HELPERS_H_
OLDNEW
« no previous file with comments | « content/child/webcrypto/openssl/sym_key_openssl.cc ('k') | content/child/webcrypto/test/test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698