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

Side by Side Diff: crypto/scoped_nss_types.h

Issue 8413024: Add ECPrivateKey for Elliptic Curve keypair generation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes Created 9 years, 1 month 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
« no previous file with comments | « crypto/ec_private_key_unittest.cc ('k') | crypto/third_party/nss/chromium-nss.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CRYPTO_SCOPED_NSS_TYPES_H_ 5 #ifndef CRYPTO_SCOPED_NSS_TYPES_H_
6 #define CRYPTO_SCOPED_NSS_TYPES_H_ 6 #define CRYPTO_SCOPED_NSS_TYPES_H_
7 #pragma once 7 #pragma once
8 8
9 #include <keyhi.h> 9 #include <keyhi.h>
10 #include <nss.h> 10 #include <nss.h>
11 #include <pk11pub.h> 11 #include <pk11pub.h>
12 #include <plarena.h>
12 13
13 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
14 15
15 namespace crypto { 16 namespace crypto {
16 17
17 template <typename Type, void (*Destroyer)(Type*)> 18 template <typename Type, void (*Destroyer)(Type*)>
18 struct NSSDestroyer { 19 struct NSSDestroyer {
19 void operator()(Type* ptr) const { 20 void operator()(Type* ptr) const {
20 if (ptr) 21 if (ptr)
21 Destroyer(ptr); 22 Destroyer(ptr);
(...skipping 24 matching lines...) Expand all
46 SECKEYPrivateKey, NSSDestroyer<SECKEYPrivateKey, SECKEY_DestroyPrivateKey> > 47 SECKEYPrivateKey, NSSDestroyer<SECKEYPrivateKey, SECKEY_DestroyPrivateKey> >
47 ScopedSECKEYPrivateKey; 48 ScopedSECKEYPrivateKey;
48 typedef scoped_ptr_malloc< 49 typedef scoped_ptr_malloc<
49 SECAlgorithmID, NSSDestroyer1<SECAlgorithmID, 50 SECAlgorithmID, NSSDestroyer1<SECAlgorithmID,
50 SECOID_DestroyAlgorithmID, 51 SECOID_DestroyAlgorithmID,
51 PR_TRUE> > ScopedSECAlgorithmID; 52 PR_TRUE> > ScopedSECAlgorithmID;
52 typedef scoped_ptr_malloc< 53 typedef scoped_ptr_malloc<
53 SECItem, NSSDestroyer1<SECItem, 54 SECItem, NSSDestroyer1<SECItem,
54 SECITEM_FreeItem, 55 SECITEM_FreeItem,
55 PR_TRUE> > ScopedSECItem; 56 PR_TRUE> > ScopedSECItem;
57 typedef scoped_ptr_malloc<
58 PLArenaPool, NSSDestroyer1<PLArenaPool,
59 PORT_FreeArena,
60 PR_FALSE> > ScopedPLArenaPool;
56 61
57 } // namespace crypto 62 } // namespace crypto
58 63
59 #endif // CRYPTO_SCOPED_NSS_TYPES_H_ 64 #endif // CRYPTO_SCOPED_NSS_TYPES_H_
OLDNEW
« no previous file with comments | « crypto/ec_private_key_unittest.cc ('k') | crypto/third_party/nss/chromium-nss.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698