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

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

Issue 698363002: webcrypto: Add ECDSA algorithm (chromium-side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extract_more
Patch Set: rebase + add another test Created 6 years, 1 month 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/status.h" 5 #include "content/child/webcrypto/status.h"
6 6
7 namespace content { 7 namespace content {
8 8
9 namespace webcrypto { 9 namespace webcrypto {
10 10
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 return Status(blink::WebCryptoErrorTypeData, 236 return Status(blink::WebCryptoErrorTypeData,
237 "Invalid key length: it is either zero or not a multiple of 8 " 237 "Invalid key length: it is either zero or not a multiple of 8 "
238 "bits"); 238 "bits");
239 } 239 }
240 240
241 Status Status::ErrorCreateKeyBadUsages() { 241 Status Status::ErrorCreateKeyBadUsages() {
242 return Status(blink::WebCryptoErrorTypeSyntax, 242 return Status(blink::WebCryptoErrorTypeSyntax,
243 "Cannot create a key using the specified key usages."); 243 "Cannot create a key using the specified key usages.");
244 } 244 }
245 245
246 Status Status::ErrorImportedEcKeyIncorrectCurve() {
247 return Status(
248 blink::WebCryptoErrorTypeData,
249 "The imported EC key specifies a different curve than requested");
250 }
251
252 Status Status::ErrorJwkIncorrectCrv() {
253 return Status(
254 blink::WebCryptoErrorTypeData,
255 "The JWK's \"crv\" member specifies a different curve than requested");
256 }
257
258 Status Status::ErrorEcKeyInvalid() {
259 return Status(blink::WebCryptoErrorTypeData,
260 "The imported EC key is invalid");
261 }
262
246 Status::Status(blink::WebCryptoErrorType error_type, 263 Status::Status(blink::WebCryptoErrorType error_type,
247 const std::string& error_details_utf8) 264 const std::string& error_details_utf8)
248 : type_(TYPE_ERROR), 265 : type_(TYPE_ERROR),
249 error_type_(error_type), 266 error_type_(error_type),
250 error_details_(error_details_utf8) { 267 error_details_(error_details_utf8) {
251 } 268 }
252 269
253 Status::Status(Type type) : type_(type) { 270 Status::Status(Type type) : type_(type) {
254 } 271 }
255 272
256 } // namespace webcrypto 273 } // namespace webcrypto
257 274
258 } // namespace content 275 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698