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

Side by Side Diff: crypto/ec_private_key.h

Issue 1408813002: Remove crypto::ECPrivateKey::IsSupported. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | crypto/ec_private_key_nss.cc » ('j') | net/socket/ssl_client_socket.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CRYPTO_EC_PRIVATE_KEY_H_ 5 #ifndef CRYPTO_EC_PRIVATE_KEY_H_
6 #define CRYPTO_EC_PRIVATE_KEY_H_ 6 #define CRYPTO_EC_PRIVATE_KEY_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 // Encapsulates an elliptic curve (EC) private key. Can be used to generate new 28 // Encapsulates an elliptic curve (EC) private key. Can be used to generate new
29 // keys, export keys to other formats, or to extract a public key. 29 // keys, export keys to other formats, or to extract a public key.
30 // TODO(mattm): make this and RSAPrivateKey implement some PrivateKey interface. 30 // TODO(mattm): make this and RSAPrivateKey implement some PrivateKey interface.
31 // (The difference in types of key() and public_key() make this a little 31 // (The difference in types of key() and public_key() make this a little
32 // tricky.) 32 // tricky.)
33 class CRYPTO_EXPORT ECPrivateKey { 33 class CRYPTO_EXPORT ECPrivateKey {
34 public: 34 public:
35 ~ECPrivateKey(); 35 ~ECPrivateKey();
36 36
37 // Returns whether the system supports elliptic curve cryptography.
38 static bool IsSupported();
39
40 // Creates a new random instance. Can return NULL if initialization fails. 37 // Creates a new random instance. Can return NULL if initialization fails.
41 // The created key will use the NIST P-256 curve. 38 // The created key will use the NIST P-256 curve.
42 // TODO(mattm): Add a curve parameter. 39 // TODO(mattm): Add a curve parameter.
43 static ECPrivateKey* Create(); 40 static ECPrivateKey* Create();
44 41
45 // Creates a new instance by importing an existing key pair. 42 // Creates a new instance by importing an existing key pair.
46 // The key pair is given as an ASN.1-encoded PKCS #8 EncryptedPrivateKeyInfo 43 // The key pair is given as an ASN.1-encoded PKCS #8 EncryptedPrivateKeyInfo
47 // block and an X.509 SubjectPublicKeyInfo block. 44 // block and an X.509 SubjectPublicKeyInfo block.
48 // Returns NULL if initialization fails. 45 // Returns NULL if initialization fails.
49 static ECPrivateKey* CreateFromEncryptedPrivateKeyInfo( 46 static ECPrivateKey* CreateFromEncryptedPrivateKeyInfo(
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 SECKEYPublicKey* public_key_; 106 SECKEYPublicKey* public_key_;
110 #endif 107 #endif
111 108
112 DISALLOW_COPY_AND_ASSIGN(ECPrivateKey); 109 DISALLOW_COPY_AND_ASSIGN(ECPrivateKey);
113 }; 110 };
114 111
115 112
116 } // namespace crypto 113 } // namespace crypto
117 114
118 #endif // CRYPTO_EC_PRIVATE_KEY_H_ 115 #endif // CRYPTO_EC_PRIVATE_KEY_H_
OLDNEW
« no previous file with comments | « no previous file | crypto/ec_private_key_nss.cc » ('j') | net/socket/ssl_client_socket.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698