| 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 "crypto/rsa_private_key.h" | 5 #include "crypto/rsa_private_key.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 scoped_array<BYTE> encoded(new BYTE[encoded_length]); | 216 scoped_array<BYTE> encoded(new BYTE[encoded_length]); |
| 217 if (!CryptEncodeObject( | 217 if (!CryptEncodeObject( |
| 218 X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, X509_PUBLIC_KEY_INFO, | 218 X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, X509_PUBLIC_KEY_INFO, |
| 219 reinterpret_cast<CERT_PUBLIC_KEY_INFO*>(key_info.get()), encoded.get(), | 219 reinterpret_cast<CERT_PUBLIC_KEY_INFO*>(key_info.get()), encoded.get(), |
| 220 &encoded_length)) { | 220 &encoded_length)) { |
| 221 NOTREACHED(); | 221 NOTREACHED(); |
| 222 return false; | 222 return false; |
| 223 } | 223 } |
| 224 | 224 |
| 225 for (size_t i = 0; i < encoded_length; ++i) | 225 output->assign(encoded.get(), encoded.get() + encoded_length); |
| 226 output->push_back(encoded[i]); | |
| 227 | |
| 228 return true; | 226 return true; |
| 229 } | 227 } |
| 230 | 228 |
| 231 } // namespace crypto | 229 } // namespace crypto |
| OLD | NEW |