| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 "specified by the Web Crypto call. The JWK usage must be a " | 92 "specified by the Web Crypto call. The JWK usage must be a " |
| 93 "superset of those requested"); | 93 "superset of those requested"); |
| 94 } | 94 } |
| 95 | 95 |
| 96 Status Status::ErrorJwkUseAndKeyopsInconsistent() { | 96 Status Status::ErrorJwkUseAndKeyopsInconsistent() { |
| 97 return Status(blink::WebCryptoErrorTypeData, | 97 return Status(blink::WebCryptoErrorTypeData, |
| 98 "The JWK \"use\" and \"key_ops\" properties were both found " | 98 "The JWK \"use\" and \"key_ops\" properties were both found " |
| 99 "but are inconsistent with each other."); | 99 "but are inconsistent with each other."); |
| 100 } | 100 } |
| 101 | 101 |
| 102 Status Status::ErrorJwkRsaPrivateKeyUnsupported() { | |
| 103 return Status(blink::WebCryptoErrorTypeNotSupported, | |
| 104 "JWK RSA key contained \"d\" property: Private key import is " | |
| 105 "not yet supported"); | |
| 106 } | |
| 107 | |
| 108 Status Status::ErrorJwkUnrecognizedKty() { | 102 Status Status::ErrorJwkUnrecognizedKty() { |
| 109 return Status(blink::WebCryptoErrorTypeData, | 103 return Status(blink::WebCryptoErrorTypeData, |
| 110 "The JWK \"kty\" property was unrecognized"); | 104 "The JWK \"kty\" property was unrecognized"); |
| 111 } | 105 } |
| 112 | 106 |
| 113 Status Status::ErrorJwkIncorrectKeyLength() { | 107 Status Status::ErrorJwkIncorrectKeyLength() { |
| 114 return Status(blink::WebCryptoErrorTypeData, | 108 return Status(blink::WebCryptoErrorTypeData, |
| 115 "The JWK \"k\" property did not include the right length " | 109 "The JWK \"k\" property did not include the right length " |
| 116 "of key data for the given algorithm."); | 110 "of key data for the given algorithm."); |
| 117 } | 111 } |
| 118 | 112 |
| 113 Status Status::ErrorJwkIncompleteOptionalRsaPrivateKey() { |
| 114 return Status(blink::WebCryptoErrorTypeData, |
| 115 "The optional JWK properties p, q, dp, dq, qi must either all " |
| 116 "be provided, or none provided"); |
| 117 } |
| 118 |
| 119 Status Status::ErrorImportEmptyKeyData() { | 119 Status Status::ErrorImportEmptyKeyData() { |
| 120 return Status(blink::WebCryptoErrorTypeData, "No key data was provided"); | 120 return Status(blink::WebCryptoErrorTypeData, "No key data was provided"); |
| 121 } | 121 } |
| 122 | 122 |
| 123 Status Status::ErrorImportAesKeyLength() { | 123 Status Status::ErrorImportAesKeyLength() { |
| 124 return Status(blink::WebCryptoErrorTypeData, | 124 return Status(blink::WebCryptoErrorTypeData, |
| 125 "AES key data must be 128, 192 or 256 bits"); | 125 "AES key data must be 128, 192 or 256 bits"); |
| 126 } | 126 } |
| 127 | 127 |
| 128 Status Status::ErrorUnexpectedKeyType() { | 128 Status Status::ErrorUnexpectedKeyType() { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 error_type_(error_type), | 204 error_type_(error_type), |
| 205 error_details_(error_details_utf8) { | 205 error_details_(error_details_utf8) { |
| 206 } | 206 } |
| 207 | 207 |
| 208 Status::Status(Type type) : type_(type) { | 208 Status::Status(Type type) : type_(type) { |
| 209 } | 209 } |
| 210 | 210 |
| 211 } // namespace webcrypto | 211 } // namespace webcrypto |
| 212 | 212 |
| 213 } // namespace content | 213 } // namespace content |
| OLD | NEW |