| 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 namespace content { | 7 namespace content { |
| 8 | 8 |
| 9 namespace webcrypto { | 9 namespace webcrypto { |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return Status(blink::WebCryptoErrorTypeData, | 98 return Status(blink::WebCryptoErrorTypeData, |
| 99 "The JWK \"kty\" property was not \"" + expected + "\""); | 99 "The JWK \"kty\" property was not \"" + expected + "\""); |
| 100 } | 100 } |
| 101 | 101 |
| 102 Status Status::ErrorJwkIncorrectKeyLength() { | 102 Status Status::ErrorJwkIncorrectKeyLength() { |
| 103 return Status(blink::WebCryptoErrorTypeData, | 103 return Status(blink::WebCryptoErrorTypeData, |
| 104 "The JWK \"k\" property did not include the right length " | 104 "The JWK \"k\" property did not include the right length " |
| 105 "of key data for the given algorithm."); | 105 "of key data for the given algorithm."); |
| 106 } | 106 } |
| 107 | 107 |
| 108 Status Status::ErrorJwkIncompleteOptionalRsaPrivateKey() { | 108 Status Status::ErrorJwkEmptyBigInteger(const std::string& property) { |
| 109 return Status(blink::WebCryptoErrorTypeData, | 109 return Status(blink::WebCryptoErrorTypeData, |
| 110 "The optional JWK properties p, q, dp, dq, qi must either all " | 110 "The JWK \"" + property + "\" property was empty."); |
| 111 "be provided, or none provided"); | 111 } |
| 112 |
| 113 Status Status::ErrorJwkBigIntegerHasLeadingZero(const std::string& property) { |
| 114 return Status( |
| 115 blink::WebCryptoErrorTypeData, |
| 116 "The JWK \"" + property + "\" property contained a leading zero."); |
| 112 } | 117 } |
| 113 | 118 |
| 114 Status Status::ErrorImportEmptyKeyData() { | 119 Status Status::ErrorImportEmptyKeyData() { |
| 115 return Status(blink::WebCryptoErrorTypeData, "No key data was provided"); | 120 return Status(blink::WebCryptoErrorTypeData, "No key data was provided"); |
| 116 } | 121 } |
| 117 | 122 |
| 118 Status Status::ErrorUnsupportedImportKeyFormat() { | 123 Status Status::ErrorUnsupportedImportKeyFormat() { |
| 119 return Status(blink::WebCryptoErrorTypeNotSupported, | 124 return Status(blink::WebCryptoErrorTypeNotSupported, |
| 120 "Unsupported import key format for algorithm"); | 125 "Unsupported import key format for algorithm"); |
| 121 } | 126 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 error_type_(error_type), | 228 error_type_(error_type), |
| 224 error_details_(error_details_utf8) { | 229 error_details_(error_details_utf8) { |
| 225 } | 230 } |
| 226 | 231 |
| 227 Status::Status(Type type) : type_(type) { | 232 Status::Status(Type type) : type_(type) { |
| 228 } | 233 } |
| 229 | 234 |
| 230 } // namespace webcrypto | 235 } // namespace webcrypto |
| 231 | 236 |
| 232 } // namespace content | 237 } // namespace content |
| OLD | NEW |