| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" |
| 11 #include "base/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 | 12 |
| 13 #pragma comment(lib, "crypt32.lib") | 13 #pragma comment(lib, "crypt32.lib") |
| 14 | 14 |
| 15 namespace crypto { | 15 namespace crypto { |
| 16 | 16 |
| 17 // static | 17 // static |
| 18 RSAPrivateKey* RSAPrivateKey::Create(uint16 num_bits) { | 18 RSAPrivateKey* RSAPrivateKey::Create(uint16 num_bits) { |
| 19 scoped_ptr<RSAPrivateKey> result(new RSAPrivateKey); | 19 scoped_ptr<RSAPrivateKey> result(new RSAPrivateKey); |
| 20 if (!result->InitProvider()) | 20 if (!result->InitProvider()) |
| 21 return NULL; | 21 return NULL; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 &encoded_length)) { | 229 &encoded_length)) { |
| 230 NOTREACHED(); | 230 NOTREACHED(); |
| 231 return false; | 231 return false; |
| 232 } | 232 } |
| 233 | 233 |
| 234 output->assign(encoded.get(), encoded.get() + encoded_length); | 234 output->assign(encoded.get(), encoded.get() + encoded_length); |
| 235 return true; | 235 return true; |
| 236 } | 236 } |
| 237 | 237 |
| 238 } // namespace crypto | 238 } // namespace crypto |
| OLD | NEW |