| 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 "chrome/renderer/extensions/platform_keys_natives.h" | 5 #include "chrome/renderer/extensions/platform_keys_natives.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 const blink::WebCryptoRsaHashedKeyGenParams* rsaHashedKeyGen = | 55 const blink::WebCryptoRsaHashedKeyGenParams* rsaHashedKeyGen = |
| 56 algorithm.RsaHashedKeyGenParams(); | 56 algorithm.RsaHashedKeyGenParams(); |
| 57 if (rsaHashedKeyGen) { | 57 if (rsaHashedKeyGen) { |
| 58 dict->SetIntegerWithoutPathExpansion("modulusLength", | 58 dict->SetIntegerWithoutPathExpansion("modulusLength", |
| 59 rsaHashedKeyGen->ModulusLengthBits()); | 59 rsaHashedKeyGen->ModulusLengthBits()); |
| 60 const blink::WebVector<unsigned char>& public_exponent = | 60 const blink::WebVector<unsigned char>& public_exponent = |
| 61 rsaHashedKeyGen->PublicExponent(); | 61 rsaHashedKeyGen->PublicExponent(); |
| 62 dict->SetWithoutPathExpansion( | 62 dict->SetWithoutPathExpansion( |
| 63 "publicExponent", | 63 "publicExponent", |
| 64 base::BinaryValue::CreateWithCopiedBuffer( | 64 base::Value::CreateWithCopiedBuffer( |
| 65 reinterpret_cast<const char*>(public_exponent.Data()), | 65 reinterpret_cast<const char*>(public_exponent.Data()), |
| 66 public_exponent.size())); | 66 public_exponent.size())); |
| 67 | 67 |
| 68 hash = &rsaHashedKeyGen->GetHash(); | 68 hash = &rsaHashedKeyGen->GetHash(); |
| 69 DCHECK(!hash->IsNull()); | 69 DCHECK(!hash->IsNull()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 const blink::WebCryptoRsaHashedImportParams* rsaHashedImport = | 72 const blink::WebCryptoRsaHashedImportParams* rsaHashedImport = |
| 73 algorithm.RsaHashedImportParams(); | 73 algorithm.RsaHashedImportParams(); |
| 74 if (rsaHashedImport) { | 74 if (rsaHashedImport) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 if (!algorithm_dict) | 124 if (!algorithm_dict) |
| 125 return; | 125 return; |
| 126 | 126 |
| 127 std::unique_ptr<content::V8ValueConverter> converter( | 127 std::unique_ptr<content::V8ValueConverter> converter( |
| 128 content::V8ValueConverter::create()); | 128 content::V8ValueConverter::create()); |
| 129 call_info.GetReturnValue().Set( | 129 call_info.GetReturnValue().Set( |
| 130 converter->ToV8Value(algorithm_dict.get(), context()->v8_context())); | 130 converter->ToV8Value(algorithm_dict.get(), context()->v8_context())); |
| 131 } | 131 } |
| 132 | 132 |
| 133 } // namespace extensions | 133 } // namespace extensions |
| OLD | NEW |