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

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

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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/child/webcrypto/algorithm.h"
6
7 #include "content/child/webcrypto/status.h"
8
9 namespace content {
10
11 namespace webcrypto {
12
13 AlgorithmImplementation::~AlgorithmImplementation() {
14 }
15
16 Status AlgorithmImplementation::Encrypt(
17 const blink::WebCryptoAlgorithm& algorithm,
18 const blink::WebCryptoKey& key,
19 const CryptoData& data,
20 std::vector<uint8>* buffer) const {
21 return Status::ErrorUnsupported();
22 }
23
24 Status AlgorithmImplementation::Decrypt(
25 const blink::WebCryptoAlgorithm& algorithm,
26 const blink::WebCryptoKey& key,
27 const CryptoData& data,
28 std::vector<uint8>* buffer) const {
29 return Status::ErrorUnsupported();
30 }
31
32 Status AlgorithmImplementation::Sign(const blink::WebCryptoAlgorithm& algorithm,
33 const blink::WebCryptoKey& key,
34 const CryptoData& data,
35 std::vector<uint8>* buffer) const {
36 return Status::ErrorUnsupported();
37 }
38
39 Status AlgorithmImplementation::VerifySignature(
40 const blink::WebCryptoAlgorithm& algorithm,
41 const blink::WebCryptoKey& key,
42 const CryptoData& signature,
43 const CryptoData& data,
44 bool* signature_match) const {
45 return Status::ErrorUnsupported();
46 }
47
48 Status AlgorithmImplementation::Digest(
49 const blink::WebCryptoAlgorithm& algorithm,
50 const CryptoData& data,
51 std::vector<uint8>* buffer) const {
52 return Status::ErrorUnsupported();
53 }
54
55 scoped_ptr<blink::WebCryptoDigestor> AlgorithmImplementation::CreateDigestor(
56 blink::WebCryptoAlgorithmId algorithm) const {
57 return scoped_ptr<blink::WebCryptoDigestor>();
58 }
59
60 Status AlgorithmImplementation::VerifyKeyUsagesBeforeGenerateKey(
61 blink::WebCryptoKeyUsageMask usage_mask) const {
62 return Status::ErrorUnsupported();
63 }
64
65 Status AlgorithmImplementation::VerifyKeyUsagesBeforeGenerateKeyPair(
66 blink::WebCryptoKeyUsageMask usage_mask,
67 blink::WebCryptoKeyUsageMask* public_usage_mask,
68 blink::WebCryptoKeyUsageMask* private_usage_mask) const {
69 *public_usage_mask = *private_usage_mask = 0;
70 return Status::ErrorUnsupported();
71 }
72
73 Status AlgorithmImplementation::GenerateSecretKey(
74 const blink::WebCryptoAlgorithm& algorithm,
75 bool extractable,
76 blink::WebCryptoKeyUsageMask usage_mask,
77 blink::WebCryptoKey* key) const {
78 return Status::ErrorUnsupported();
79 }
80
81 Status AlgorithmImplementation::GenerateKeyPair(
82 const blink::WebCryptoAlgorithm& algorithm,
83 bool extractable,
84 blink::WebCryptoKeyUsageMask public_usage_mask,
85 blink::WebCryptoKeyUsageMask private_usage_mask,
86 blink::WebCryptoKey* public_key,
87 blink::WebCryptoKey* private_key) const {
88 return Status::ErrorUnsupported();
89 }
90
91 Status AlgorithmImplementation::VerifyKeyUsagesBeforeImportKey(
92 blink::WebCryptoKeyFormat format,
93 blink::WebCryptoKeyUsageMask usage_mask) const {
94 return Status::ErrorUnsupportedImportKeyFormat();
95 }
96
97 Status AlgorithmImplementation::ImportKeyRaw(
98 const CryptoData& key_data,
99 const blink::WebCryptoAlgorithm& algorithm,
100 bool extractable,
101 blink::WebCryptoKeyUsageMask usage_mask,
102 blink::WebCryptoKey* key) const {
103 return Status::ErrorUnsupportedImportKeyFormat();
104 }
105
106 Status AlgorithmImplementation::ImportKeyPkcs8(
107 const CryptoData& key_data,
108 const blink::WebCryptoAlgorithm& algorithm,
109 bool extractable,
110 blink::WebCryptoKeyUsageMask usage_mask,
111 blink::WebCryptoKey* key) const {
112 return Status::ErrorUnsupportedImportKeyFormat();
113 }
114
115 Status AlgorithmImplementation::ImportKeySpki(
116 const CryptoData& key_data,
117 const blink::WebCryptoAlgorithm& algorithm,
118 bool extractable,
119 blink::WebCryptoKeyUsageMask usage_mask,
120 blink::WebCryptoKey* key) const {
121 return Status::ErrorUnsupportedImportKeyFormat();
122 }
123
124 Status AlgorithmImplementation::ImportKeyJwk(
125 const CryptoData& key_data,
126 const blink::WebCryptoAlgorithm& algorithm,
127 bool extractable,
128 blink::WebCryptoKeyUsageMask usage_mask,
129 blink::WebCryptoKey* key) const {
130 return Status::ErrorUnsupportedImportKeyFormat();
131 }
132
133 Status AlgorithmImplementation::ExportKeyRaw(const blink::WebCryptoKey& key,
134 std::vector<uint8>* buffer) const {
135 return Status::ErrorUnsupportedExportKeyFormat();
136 }
137
138 Status AlgorithmImplementation::ExportKeyPkcs8(
139 const blink::WebCryptoKey& key,
140 std::vector<uint8>* buffer) const {
141 return Status::ErrorUnsupportedExportKeyFormat();
142 }
143
144 Status AlgorithmImplementation::ExportKeySpki(
145 const blink::WebCryptoKey& key,
146 std::vector<uint8>* buffer) const {
147 return Status::ErrorUnsupportedExportKeyFormat();
148 }
149
150 Status AlgorithmImplementation::ExportKeyJwk(const blink::WebCryptoKey& key,
151 std::vector<uint8>* buffer) const {
152 return Status::ErrorUnsupportedExportKeyFormat();
153 }
154
155 } // namespace webcrypto
156
157 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698