Index: content/child/webcrypto/status.cc |
diff --git a/content/child/webcrypto/status.cc b/content/child/webcrypto/status.cc |
index a7afdb3c063968da78fbcb626eaaabef99a04ca5..a86a07cad1e3be38ed63fc0e4449472bb12e9c39 100644 |
--- a/content/child/webcrypto/status.cc |
+++ b/content/child/webcrypto/status.cc |
@@ -4,6 +4,9 @@ |
#include "content/child/webcrypto/status.h" |
+#include "base/format_macros.h" |
+#include "base/strings/stringprintf.h" |
+ |
namespace content { |
namespace webcrypto { |
@@ -243,6 +246,34 @@ Status Status::ErrorCreateKeyBadUsages() { |
"Cannot create a key using the specified key usages."); |
} |
+Status Status::ErrorImportedEcKeyIncorrectCurve() { |
+ return Status( |
+ blink::WebCryptoErrorTypeData, |
+ "The imported EC key specifies a different curve than requested"); |
+} |
+ |
+Status Status::ErrorJwkIncorrectCrv() { |
+ return Status( |
+ blink::WebCryptoErrorTypeData, |
+ "The JWK's \"crv\" member specifies a different curve than requested"); |
+} |
+ |
+Status Status::ErrorEcKeyInvalid() { |
+ return Status(blink::WebCryptoErrorTypeData, |
+ "The imported EC key is invalid"); |
+} |
+ |
+Status Status::JwkOctetStringWrongLength(const std::string& member_name, |
+ size_t expected_length, |
+ size_t actual_length) { |
+ return Status( |
+ blink::WebCryptoErrorTypeData, |
+ base::StringPrintf( |
+ "The JWK's \"%s\" member defines an octet string of length %" PRIuS |
+ " bytes but should be %" PRIuS, |
+ member_name.c_str(), actual_length, expected_length)); |
+} |
+ |
Status::Status(blink::WebCryptoErrorType error_type, |
const std::string& error_details_utf8) |
: type_(TYPE_ERROR), |