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

Side by Side Diff: content/child/webcrypto/algorithm_implementation.cc

Issue 512023002: Refactor the interface for generating keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 #include "content/child/webcrypto/algorithm_implementation.h" 5 #include "content/child/webcrypto/algorithm_implementation.h"
6 6
7 #include "content/child/webcrypto/status.h" 7 #include "content/child/webcrypto/status.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 return Status::ErrorUnsupported(); 45 return Status::ErrorUnsupported();
46 } 46 }
47 47
48 Status AlgorithmImplementation::Digest( 48 Status AlgorithmImplementation::Digest(
49 const blink::WebCryptoAlgorithm& algorithm, 49 const blink::WebCryptoAlgorithm& algorithm,
50 const CryptoData& data, 50 const CryptoData& data,
51 std::vector<uint8_t>* buffer) const { 51 std::vector<uint8_t>* buffer) const {
52 return Status::ErrorUnsupported(); 52 return Status::ErrorUnsupported();
53 } 53 }
54 54
55 Status AlgorithmImplementation::VerifyKeyUsagesBeforeGenerateKey( 55 Status AlgorithmImplementation::GenerateKey(
56 blink::WebCryptoKeyUsageMask usage_mask) const {
57 return Status::ErrorUnsupported();
58 }
59
60 Status AlgorithmImplementation::VerifyKeyUsagesBeforeGenerateKeyPair(
61 blink::WebCryptoKeyUsageMask usage_mask,
62 blink::WebCryptoKeyUsageMask* public_usage_mask,
63 blink::WebCryptoKeyUsageMask* private_usage_mask) const {
64 *public_usage_mask = *private_usage_mask = 0;
65 return Status::ErrorUnsupported();
66 }
67
68 Status AlgorithmImplementation::GenerateSecretKey(
69 const blink::WebCryptoAlgorithm& algorithm, 56 const blink::WebCryptoAlgorithm& algorithm,
70 bool extractable, 57 bool extractable,
71 blink::WebCryptoKeyUsageMask usage_mask, 58 blink::WebCryptoKeyUsageMask usage_mask,
72 blink::WebCryptoKey* key) const {
73 return Status::ErrorUnsupported();
74 }
75
76 Status AlgorithmImplementation::GenerateKeyPair(
77 const blink::WebCryptoAlgorithm& algorithm,
78 bool extractable,
79 blink::WebCryptoKeyUsageMask public_usage_mask,
80 blink::WebCryptoKeyUsageMask private_usage_mask,
81 blink::WebCryptoKey* public_key, 59 blink::WebCryptoKey* public_key,
82 blink::WebCryptoKey* private_key) const { 60 blink::WebCryptoKey* private_key) const {
83 return Status::ErrorUnsupported(); 61 return Status::ErrorUnsupported();
84 } 62 }
85 63
86 Status AlgorithmImplementation::VerifyKeyUsagesBeforeImportKey( 64 Status AlgorithmImplementation::VerifyKeyUsagesBeforeImportKey(
87 blink::WebCryptoKeyFormat format, 65 blink::WebCryptoKeyFormat format,
88 blink::WebCryptoKeyUsageMask usage_mask) const { 66 blink::WebCryptoKeyUsageMask usage_mask) const {
89 return Status::ErrorUnsupportedImportKeyFormat(); 67 return Status::ErrorUnsupportedImportKeyFormat();
90 } 68 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 123
146 Status AlgorithmImplementation::ExportKeyJwk( 124 Status AlgorithmImplementation::ExportKeyJwk(
147 const blink::WebCryptoKey& key, 125 const blink::WebCryptoKey& key,
148 std::vector<uint8_t>* buffer) const { 126 std::vector<uint8_t>* buffer) const {
149 return Status::ErrorUnsupportedExportKeyFormat(); 127 return Status::ErrorUnsupportedExportKeyFormat();
150 } 128 }
151 129
152 } // namespace webcrypto 130 } // namespace webcrypto
153 131
154 } // namespace content 132 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698