OLD | NEW |
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 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 return Status(blink::WebCryptoErrorTypeData, | 245 return Status(blink::WebCryptoErrorTypeData, |
246 "Invalid key length: it is either zero or not a multiple of 8 " | 246 "Invalid key length: it is either zero or not a multiple of 8 " |
247 "bits"); | 247 "bits"); |
248 } | 248 } |
249 | 249 |
250 Status Status::ErrorCreateKeyBadUsages() { | 250 Status Status::ErrorCreateKeyBadUsages() { |
251 return Status(blink::WebCryptoErrorTypeSyntax, | 251 return Status(blink::WebCryptoErrorTypeSyntax, |
252 "Cannot create a key using the specified key usages."); | 252 "Cannot create a key using the specified key usages."); |
253 } | 253 } |
254 | 254 |
| 255 Status Status::ErrorCreateKeyEmptyUsages() { |
| 256 return Status(blink::WebCryptoErrorTypeSyntax, |
| 257 "Usages cannot be empty when creating a key."); |
| 258 } |
| 259 |
255 Status Status::ErrorImportedEcKeyIncorrectCurve() { | 260 Status Status::ErrorImportedEcKeyIncorrectCurve() { |
256 return Status( | 261 return Status( |
257 blink::WebCryptoErrorTypeData, | 262 blink::WebCryptoErrorTypeData, |
258 "The imported EC key specifies a different curve than requested"); | 263 "The imported EC key specifies a different curve than requested"); |
259 } | 264 } |
260 | 265 |
261 Status Status::ErrorJwkIncorrectCrv() { | 266 Status Status::ErrorJwkIncorrectCrv() { |
262 return Status( | 267 return Status( |
263 blink::WebCryptoErrorTypeData, | 268 blink::WebCryptoErrorTypeData, |
264 "The JWK's \"crv\" member specifies a different curve than requested"); | 269 "The JWK's \"crv\" member specifies a different curve than requested"); |
(...skipping 21 matching lines...) Expand all Loading... |
286 error_type_(error_type), | 291 error_type_(error_type), |
287 error_details_(error_details_utf8) { | 292 error_details_(error_details_utf8) { |
288 } | 293 } |
289 | 294 |
290 Status::Status(Type type) : type_(type) { | 295 Status::Status(Type type) : type_(type) { |
291 } | 296 } |
292 | 297 |
293 } // namespace webcrypto | 298 } // namespace webcrypto |
294 | 299 |
295 } // namespace content | 300 } // namespace content |
OLD | NEW |