OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 } | 172 } |
173 | 173 |
174 copyStringProperty("use", dict, jsonObject.get()); | 174 copyStringProperty("use", dict, jsonObject.get()); |
175 copySequenceOfStringProperty("key_ops", dict, jsonObject.get()); | 175 copySequenceOfStringProperty("key_ops", dict, jsonObject.get()); |
176 copyStringProperty("alg", dict, jsonObject.get()); | 176 copyStringProperty("alg", dict, jsonObject.get()); |
177 | 177 |
178 bool ext; | 178 bool ext; |
179 if (DictionaryHelper::get(dict, "ext", ext)) | 179 if (DictionaryHelper::get(dict, "ext", ext)) |
180 jsonObject->setBoolean("ext", ext); | 180 jsonObject->setBoolean("ext", ext); |
181 | 181 |
182 const char* const propertyNames[] = { "d", "n", "e", "p", "q", "dp", "dq", "
qi", "k" }; | 182 const char* const propertyNames[] = { "d", "n", "e", "p", "q", "dp", "dq", "
qi", "k", "crv", "x", "y" }; |
183 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(propertyNames); ++i) | 183 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(propertyNames); ++i) |
184 copyStringProperty(propertyNames[i], dict, jsonObject.get()); | 184 copyStringProperty(propertyNames[i], dict, jsonObject.get()); |
185 | 185 |
186 String json = jsonObject->toJSONString(); | 186 String json = jsonObject->toJSONString(); |
187 jsonUtf8 = json.utf8(); | 187 jsonUtf8 = json.utf8(); |
188 return true; | 188 return true; |
189 } | 189 } |
190 | 190 |
191 SubtleCrypto::SubtleCrypto() | 191 SubtleCrypto::SubtleCrypto() |
192 { | 192 { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 return promise; | 390 return promise; |
391 | 391 |
392 if (!unwrappingKey->canBeUsedForAlgorithm(unwrapAlgorithm, WebCryptoOperatio
nUnwrapKey, result.get())) | 392 if (!unwrappingKey->canBeUsedForAlgorithm(unwrapAlgorithm, WebCryptoOperatio
nUnwrapKey, result.get())) |
393 return promise; | 393 return promise; |
394 | 394 |
395 Platform::current()->crypto()->unwrapKey(format, wrappedKey.bytes(), wrapped
Key.byteLength(), unwrappingKey->key(), unwrapAlgorithm, unwrappedKeyAlgorithm,
extractable, keyUsages, result->result()); | 395 Platform::current()->crypto()->unwrapKey(format, wrappedKey.bytes(), wrapped
Key.byteLength(), unwrappingKey->key(), unwrapAlgorithm, unwrappedKeyAlgorithm,
extractable, keyUsages, result->result()); |
396 return promise; | 396 return promise; |
397 } | 397 } |
398 | 398 |
399 } // namespace blink | 399 } // namespace blink |
OLD | NEW |