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 | |
260 Status Status::ErrorImportedEcKeyIncorrectCurve() { | 255 Status Status::ErrorImportedEcKeyIncorrectCurve() { |
261 return Status( | 256 return Status( |
262 blink::WebCryptoErrorTypeData, | 257 blink::WebCryptoErrorTypeData, |
263 "The imported EC key specifies a different curve than requested"); | 258 "The imported EC key specifies a different curve than requested"); |
264 } | 259 } |
265 | 260 |
266 Status Status::ErrorJwkIncorrectCrv() { | 261 Status Status::ErrorJwkIncorrectCrv() { |
267 return Status( | 262 return Status( |
268 blink::WebCryptoErrorTypeData, | 263 blink::WebCryptoErrorTypeData, |
269 "The JWK's \"crv\" member specifies a different curve than requested"); | 264 "The JWK's \"crv\" member specifies a different curve than requested"); |
(...skipping 21 matching lines...) Expand all Loading... |
291 error_type_(error_type), | 286 error_type_(error_type), |
292 error_details_(error_details_utf8) { | 287 error_details_(error_details_utf8) { |
293 } | 288 } |
294 | 289 |
295 Status::Status(Type type) : type_(type) { | 290 Status::Status(Type type) : type_(type) { |
296 } | 291 } |
297 | 292 |
298 } // namespace webcrypto | 293 } // namespace webcrypto |
299 | 294 |
300 } // namespace content | 295 } // namespace content |
OLD | NEW |