| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/base/keygen_handler.h" | 5 #include "net/base/keygen_handler.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <wincrypt.h> | 8 #include <wincrypt.h> |
| 9 #pragma comment(lib, "crypt32.lib") | 9 #pragma comment(lib, "crypt32.lib") |
| 10 #include <rpc.h> | 10 #include <rpc.h> |
| 11 #pragma comment(lib, "rpcrt4.lib") | 11 #pragma comment(lib, "rpcrt4.lib") |
| 12 | 12 |
| 13 #include <list> | 13 #include <list> |
| 14 #include <string> | 14 #include <string> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "base/base64.h" | 17 #include "base/base64.h" |
| 18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/string_piece.h" | |
| 21 #include "base/string_util.h" | 20 #include "base/string_util.h" |
| 21 #include "base/strings/string_piece.h" |
| 22 #include "base/utf_string_conversions.h" | 22 #include "base/utf_string_conversions.h" |
| 23 #include "crypto/capi_util.h" | 23 #include "crypto/capi_util.h" |
| 24 #include "crypto/scoped_capi_types.h" | 24 #include "crypto/scoped_capi_types.h" |
| 25 | 25 |
| 26 | 26 |
| 27 namespace net { | 27 namespace net { |
| 28 | 28 |
| 29 // Assigns the contents of a CERT_PUBLIC_KEY_INFO structure for the signing | 29 // Assigns the contents of a CERT_PUBLIC_KEY_INFO structure for the signing |
| 30 // key in |prov| to |output|. Returns true if encoding was successful. | 30 // key in |prov| to |output|. Returns true if encoding was successful. |
| 31 bool GetSubjectPublicKeyInfo(HCRYPTPROV prov, std::vector<BYTE>* output) { | 31 bool GetSubjectPublicKeyInfo(HCRYPTPROV prov, std::vector<BYTE>* output) { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 LOG(ERROR) << "Keygen failed: Couldn't convert signed key into base64"; | 215 LOG(ERROR) << "Keygen failed: Couldn't convert signed key into base64"; |
| 216 return std::string(); | 216 return std::string(); |
| 217 } | 217 } |
| 218 | 218 |
| 219 VLOG(1) << "Keygen succeeded"; | 219 VLOG(1) << "Keygen succeeded"; |
| 220 return result; | 220 return result; |
| 221 } | 221 } |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace net | 224 } // namespace net |
| OLD | NEW |