Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(680)

Side by Side Diff: crypto/rsa_private_key_nss.cc

Issue 6805019: Move crypto files out of base, to a top level directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/crypto/rsa_private_key.h" 5 #include "base/crypto/rsa_private_key.h"
6 6
7 #include <cryptohi.h> 7 #include <cryptohi.h>
8 #include <keyhi.h> 8 #include <keyhi.h>
9 #include <pk11pub.h> 9 #include <pk11pub.h>
10 10
(...skipping 21 matching lines...) Expand all
32 return false; 32 return false;
33 } 33 }
34 34
35 output->assign(item.data, item.data + item.len); 35 output->assign(item.data, item.data + item.len);
36 SECITEM_FreeItem(&item, PR_FALSE); 36 SECITEM_FreeItem(&item, PR_FALSE);
37 return true; 37 return true;
38 } 38 }
39 39
40 } // namespace 40 } // namespace
41 41
42 namespace base { 42 namespace crypto {
43 43
44 RSAPrivateKey::~RSAPrivateKey() { 44 RSAPrivateKey::~RSAPrivateKey() {
45 if (key_) 45 if (key_)
46 SECKEY_DestroyPrivateKey(key_); 46 SECKEY_DestroyPrivateKey(key_);
47 if (public_key_) 47 if (public_key_)
48 SECKEY_DestroyPublicKey(public_key_); 48 SECKEY_DestroyPublicKey(public_key_);
49 } 49 }
50 50
51 // static 51 // static
52 RSAPrivateKey* RSAPrivateKey::Create(uint16 num_bits) { 52 RSAPrivateKey* RSAPrivateKey::Create(uint16 num_bits) {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 result->public_key_ = SECKEY_ConvertToPublicKey(result->key_); 239 result->public_key_ = SECKEY_ConvertToPublicKey(result->key_);
240 if (!result->public_key_) { 240 if (!result->public_key_) {
241 NOTREACHED(); 241 NOTREACHED();
242 return NULL; 242 return NULL;
243 } 243 }
244 244
245 return result.release(); 245 return result.release();
246 } 246 }
247 247
248 } // namespace base 248 } // namespace crypto
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698