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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 Status Status::ErrorGenerateHmacKeyLengthZero() { | 261 Status Status::ErrorGenerateHmacKeyLengthZero() { |
262 return Status(blink::WebCryptoErrorTypeOperation, | 262 return Status(blink::WebCryptoErrorTypeOperation, |
263 "HMAC key length must be not be zero"); | 263 "HMAC key length must be not be zero"); |
264 } | 264 } |
265 | 265 |
266 Status Status::ErrorCreateKeyBadUsages() { | 266 Status Status::ErrorCreateKeyBadUsages() { |
267 return Status(blink::WebCryptoErrorTypeSyntax, | 267 return Status(blink::WebCryptoErrorTypeSyntax, |
268 "Cannot create a key using the specified key usages."); | 268 "Cannot create a key using the specified key usages."); |
269 } | 269 } |
270 | 270 |
| 271 Status Status::ErrorCreateKeyEmptyUsages() { |
| 272 return Status(blink::WebCryptoErrorTypeSyntax, |
| 273 "Usages cannot be empty when creating a key."); |
| 274 } |
| 275 |
271 Status Status::ErrorImportedEcKeyIncorrectCurve() { | 276 Status Status::ErrorImportedEcKeyIncorrectCurve() { |
272 return Status( | 277 return Status( |
273 blink::WebCryptoErrorTypeData, | 278 blink::WebCryptoErrorTypeData, |
274 "The imported EC key specifies a different curve than requested"); | 279 "The imported EC key specifies a different curve than requested"); |
275 } | 280 } |
276 | 281 |
277 Status Status::ErrorJwkIncorrectCrv() { | 282 Status Status::ErrorJwkIncorrectCrv() { |
278 return Status( | 283 return Status( |
279 blink::WebCryptoErrorTypeData, | 284 blink::WebCryptoErrorTypeData, |
280 "The JWK's \"crv\" member specifies a different curve than requested"); | 285 "The JWK's \"crv\" member specifies a different curve than requested"); |
(...skipping 21 matching lines...) Expand all Loading... |
302 error_type_(error_type), | 307 error_type_(error_type), |
303 error_details_(error_details_utf8) { | 308 error_details_(error_details_utf8) { |
304 } | 309 } |
305 | 310 |
306 Status::Status(Type type) : type_(type) { | 311 Status::Status(Type type) : type_(type) { |
307 } | 312 } |
308 | 313 |
309 } // namespace webcrypto | 314 } // namespace webcrypto |
310 | 315 |
311 } // namespace content | 316 } // namespace content |
OLD | NEW |