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

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

Issue 379383002: Refactor WebCrypto code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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_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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 const CryptoData& private_exponent, 217 const CryptoData& private_exponent,
218 const CryptoData& prime1, 218 const CryptoData& prime1,
219 const CryptoData& prime2, 219 const CryptoData& prime2,
220 const CryptoData& exponent1, 220 const CryptoData& exponent1,
221 const CryptoData& exponent2, 221 const CryptoData& exponent2,
222 const CryptoData& coefficient, 222 const CryptoData& coefficient,
223 blink::WebCryptoKey* key); 223 blink::WebCryptoKey* key);
224 224
225 // Note that this may be called from target Blink thread. 225 // Note that this may be called from target Blink thread.
226 // Preconditions: 226 // Preconditions:
227 // * algorithm is for an asymmetric algorithm
227 // * usage_mask makes sense for the algorithm. 228 // * usage_mask makes sense for the algorithm.
229 // * key_data is not zero-length.
228 Status ImportKeySpki(const blink::WebCryptoAlgorithm& algorithm, 230 Status ImportKeySpki(const blink::WebCryptoAlgorithm& algorithm,
229 const CryptoData& key_data, 231 const CryptoData& key_data,
230 bool extractable, 232 bool extractable,
231 blink::WebCryptoKeyUsageMask usage_mask, 233 blink::WebCryptoKeyUsageMask usage_mask,
232 blink::WebCryptoKey* key); 234 blink::WebCryptoKey* key);
233 235
234 // Note that this may be called from target Blink thread. 236 // Note that this may be called from target Blink thread.
235 // Preconditions: 237 // Preconditions:
238 // * algorithm is for an asymmetric algorithm
236 // * usage_mask makes sense for the algorithm. 239 // * usage_mask makes sense for the algorithm.
240 // * key_data is not zero-length.
237 Status ImportKeyPkcs8(const blink::WebCryptoAlgorithm& algorithm, 241 Status ImportKeyPkcs8(const blink::WebCryptoAlgorithm& algorithm,
238 const CryptoData& key_data, 242 const CryptoData& key_data,
239 bool extractable, 243 bool extractable,
240 blink::WebCryptoKeyUsageMask usage_mask, 244 blink::WebCryptoKeyUsageMask usage_mask,
241 blink::WebCryptoKey* key); 245 blink::WebCryptoKey* key);
242 246
243 // Preconditions: 247 // Preconditions:
244 // * |key| is non-null. 248 // * |key| is non-null.
245 Status ExportKeyRaw(SymKey* key, std::vector<uint8>* buffer); 249 Status ExportKeyRaw(SymKey* key, std::vector<uint8>* buffer);
246 250
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 const CryptoData& data, 287 const CryptoData& data,
284 std::vector<uint8>* buffer); 288 std::vector<uint8>* buffer);
285 289
286 } // namespace platform 290 } // namespace platform
287 291
288 } // namespace webcrypto 292 } // namespace webcrypto
289 293
290 } // namespace content 294 } // namespace content
291 295
292 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ 296 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698