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

Side by Side Diff: components/webcrypto/nss/sym_key_nss.cc

Issue 1077273002: html_viewer: Move webcrypto to a place where html_viewer can use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT Created 5 years, 8 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
« no previous file with comments | « components/webcrypto/nss/sym_key_nss.h ('k') | components/webcrypto/nss/util_nss.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/child/webcrypto/nss/sym_key_nss.h" 5 #include "components/webcrypto/nss/sym_key_nss.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/child/webcrypto/crypto_data.h" 8 #include "components/webcrypto/crypto_data.h"
9 #include "content/child/webcrypto/generate_key_result.h" 9 #include "components/webcrypto/generate_key_result.h"
10 #include "content/child/webcrypto/nss/key_nss.h" 10 #include "components/webcrypto/nss/key_nss.h"
11 #include "content/child/webcrypto/nss/util_nss.h" 11 #include "components/webcrypto/nss/util_nss.h"
12 #include "content/child/webcrypto/status.h" 12 #include "components/webcrypto/status.h"
13 #include "content/child/webcrypto/webcrypto_util.h" 13 #include "components/webcrypto/webcrypto_util.h"
14 #include "crypto/scoped_nss_types.h" 14 #include "crypto/scoped_nss_types.h"
15 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" 15 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h"
16 16
17 namespace content {
18
19 namespace webcrypto { 17 namespace webcrypto {
20 18
21 Status GenerateSecretKeyNss(const blink::WebCryptoKeyAlgorithm& algorithm, 19 Status GenerateSecretKeyNss(const blink::WebCryptoKeyAlgorithm& algorithm,
22 bool extractable, 20 bool extractable,
23 blink::WebCryptoKeyUsageMask usages, 21 blink::WebCryptoKeyUsageMask usages,
24 unsigned int keylen_bits, 22 unsigned int keylen_bits,
25 CK_MECHANISM_TYPE mechanism, 23 CK_MECHANISM_TYPE mechanism,
26 GenerateKeyResult* result) { 24 GenerateKeyResult* result) {
27 DCHECK_NE(CKM_INVALID_MECHANISM, mechanism); 25 DCHECK_NE(CKM_INVALID_MECHANISM, mechanism);
28 26
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 67
70 scoped_ptr<SymKeyNss> handle(new SymKeyNss(pk11_sym_key.Pass(), key_data)); 68 scoped_ptr<SymKeyNss> handle(new SymKeyNss(pk11_sym_key.Pass(), key_data));
71 69
72 *key = blink::WebCryptoKey::create(handle.release(), 70 *key = blink::WebCryptoKey::create(handle.release(),
73 blink::WebCryptoKeyTypeSecret, extractable, 71 blink::WebCryptoKeyTypeSecret, extractable,
74 algorithm, usages); 72 algorithm, usages);
75 return Status::Success(); 73 return Status::Success();
76 } 74 }
77 75
78 } // namespace webcrypto 76 } // namespace webcrypto
79
80 } // namespace content
OLDNEW
« no previous file with comments | « components/webcrypto/nss/sym_key_nss.h ('k') | components/webcrypto/nss/util_nss.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698