OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/webcrypto/blink_key_handle.h" | 5 #include "components/webcrypto/blink_key_handle.h" |
6 | 6 |
7 #include <openssl/evp.h> | |
8 | |
9 #include <utility> | 7 #include <utility> |
10 | 8 |
11 #include "base/logging.h" | 9 #include "base/logging.h" |
12 #include "base/macros.h" | 10 #include "base/macros.h" |
13 #include "components/webcrypto/crypto_data.h" | 11 #include "components/webcrypto/crypto_data.h" |
14 #include "components/webcrypto/status.h" | 12 #include "components/webcrypto/status.h" |
| 13 #include "third_party/boringssl/src/include/openssl/evp.h" |
15 | 14 |
16 namespace webcrypto { | 15 namespace webcrypto { |
17 | 16 |
18 namespace { | 17 namespace { |
19 | 18 |
20 class SymKey; | 19 class SymKey; |
21 class AsymKey; | 20 class AsymKey; |
22 | 21 |
23 // Base class for wrapping OpenSSL keys in a type that can be passed to | 22 // Base class for wrapping OpenSSL keys in a type that can be passed to |
24 // Blink (blink::WebCryptoKeyHandle). | 23 // Blink (blink::WebCryptoKeyHandle). |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 return new SymKey(key_bytes); | 110 return new SymKey(key_bytes); |
112 } | 111 } |
113 | 112 |
114 blink::WebCryptoKeyHandle* CreateAsymmetricKeyHandle( | 113 blink::WebCryptoKeyHandle* CreateAsymmetricKeyHandle( |
115 bssl::UniquePtr<EVP_PKEY> pkey, | 114 bssl::UniquePtr<EVP_PKEY> pkey, |
116 const std::vector<uint8_t>& serialized_key_data) { | 115 const std::vector<uint8_t>& serialized_key_data) { |
117 return new AsymKey(std::move(pkey), serialized_key_data); | 116 return new AsymKey(std::move(pkey), serialized_key_data); |
118 } | 117 } |
119 | 118 |
120 } // namespace webcrypto | 119 } // namespace webcrypto |
OLD | NEW |