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
3 // found in the LICENSE file.
5 #include "crypto/rsa_private_key.h"
7 #include "base/logging.h"
11 // |RSAPrivateKey| is not used on iOS. This implementation was written so that
12 // it would compile. It may be possible to use the NSS implementation as a real
13 // implementation, but it hasn't yet been necessary.
16 RSAPrivateKey
* RSAPrivateKey::Create(uint16 num_bits
) {
22 RSAPrivateKey
* RSAPrivateKey::CreateSensitive(uint16 num_bits
) {
28 RSAPrivateKey
* RSAPrivateKey::CreateFromPrivateKeyInfo(
29 const std::vector
<uint8
>& input
) {
35 RSAPrivateKey
* RSAPrivateKey::CreateSensitiveFromPrivateKeyInfo(
36 const std::vector
<uint8
>& input
) {
42 RSAPrivateKey
* RSAPrivateKey::FindFromPublicKeyInfo(
43 const std::vector
<uint8
>& input
) {
48 RSAPrivateKey::RSAPrivateKey() : key_(NULL
), public_key_(NULL
) {}
50 RSAPrivateKey::~RSAPrivateKey() {
52 CFRelease(public_key_
);
57 bool RSAPrivateKey::ExportPrivateKey(std::vector
<uint8
>* output
) const {
62 bool RSAPrivateKey::ExportPublicKey(std::vector
<uint8
>* output
) const {