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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 Status Status::ErrorJwkUnrecognizedAlgorithm() { | 50 Status Status::ErrorJwkUnrecognizedAlgorithm() { |
51 return Status("The JWK \"alg\" property was not recognized"); | 51 return Status("The JWK \"alg\" property was not recognized"); |
52 } | 52 } |
53 | 53 |
54 Status Status::ErrorJwkAlgorithmInconsistent() { | 54 Status Status::ErrorJwkAlgorithmInconsistent() { |
55 return Status( | 55 return Status( |
56 "The JWK \"alg\" property was inconsistent with that specified " | 56 "The JWK \"alg\" property was inconsistent with that specified " |
57 "by the Web Crypto call"); | 57 "by the Web Crypto call"); |
58 } | 58 } |
59 | 59 |
60 Status Status::ErrorJwkAlgorithmMissing() { | |
61 return Status( | |
62 "The JWK optional \"alg\" property is missing or not a string, " | |
63 "and one wasn't specified by the Web Crypto call"); | |
64 } | |
65 | |
66 Status Status::ErrorJwkUnrecognizedUse() { | 60 Status Status::ErrorJwkUnrecognizedUse() { |
67 return Status("The JWK \"use\" property could not be parsed"); | 61 return Status("The JWK \"use\" property could not be parsed"); |
68 } | 62 } |
69 | 63 |
70 Status Status::ErrorJwkUnrecognizedKeyop() { | 64 Status Status::ErrorJwkUnrecognizedKeyop() { |
71 return Status("The JWK \"key_ops\" property could not be parsed"); | 65 return Status("The JWK \"key_ops\" property could not be parsed"); |
72 } | 66 } |
73 | 67 |
74 Status Status::ErrorJwkUseInconsistent() { | 68 Status Status::ErrorJwkUseInconsistent() { |
75 return Status( | 69 return Status( |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 Status Status::ErrorInvalidAesKwDataLength() { | 138 Status Status::ErrorInvalidAesKwDataLength() { |
145 return Status( | 139 return Status( |
146 "The AES-KW input data length is invalid: not a multiple of 8 " | 140 "The AES-KW input data length is invalid: not a multiple of 8 " |
147 "bytes"); | 141 "bytes"); |
148 } | 142 } |
149 | 143 |
150 Status Status::ErrorGenerateKeyPublicExponent() { | 144 Status Status::ErrorGenerateKeyPublicExponent() { |
151 return Status("The \"publicExponent\" is either empty, zero, or too large"); | 145 return Status("The \"publicExponent\" is either empty, zero, or too large"); |
152 } | 146 } |
153 | 147 |
154 Status Status::ErrorMissingAlgorithmImportRawKey() { | |
155 return Status( | |
156 "The key's algorithm must be specified when importing " | |
157 "raw-formatted key."); | |
158 } | |
159 | |
160 Status Status::ErrorMissingAlgorithmUnwrapRawKey() { | |
161 return Status( | |
162 "The key's algorithm must be specified when unwrapping a " | |
163 "raw-formatted key."); | |
164 } | |
165 | |
166 Status Status::ErrorImportRsaEmptyModulus() { | 148 Status Status::ErrorImportRsaEmptyModulus() { |
167 return Status("The modulus is empty"); | 149 return Status("The modulus is empty"); |
168 } | 150 } |
169 | 151 |
170 Status Status::ErrorGenerateRsaZeroModulus() { | 152 Status Status::ErrorGenerateRsaZeroModulus() { |
171 return Status("The modulus bit length cannot be zero"); | 153 return Status("The modulus bit length cannot be zero"); |
172 } | 154 } |
173 | 155 |
174 Status Status::ErrorImportRsaEmptyExponent() { | 156 Status Status::ErrorImportRsaEmptyExponent() { |
175 return Status("No bytes for the exponent were provided"); | 157 return Status("No bytes for the exponent were provided"); |
(...skipping 11 matching lines...) Expand all Loading... |
187 | 169 |
188 Status::Status(const std::string& error_details_utf8) | 170 Status::Status(const std::string& error_details_utf8) |
189 : type_(TYPE_ERROR), error_details_(error_details_utf8) {} | 171 : type_(TYPE_ERROR), error_details_(error_details_utf8) {} |
190 | 172 |
191 Status::Status(Type type) : type_(type) {} | 173 Status::Status(Type type) : type_(type) {} |
192 | 174 |
193 | 175 |
194 } // namespace webcrypto | 176 } // namespace webcrypto |
195 | 177 |
196 } // namespace content | 178 } // namespace content |
OLD | NEW |