OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_ | 5 #ifndef NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_ |
6 #define NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_ | 6 #define NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_ |
7 | 7 |
8 #include <openssl/evp.h> | 8 #include <openssl/evp.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 private: | 69 private: |
70 // KeyPair is an internal class used to hold a pair of private / public | 70 // KeyPair is an internal class used to hold a pair of private / public |
71 // EVP_PKEY objects, with appropriate ownership. | 71 // EVP_PKEY objects, with appropriate ownership. |
72 class KeyPair { | 72 class KeyPair { |
73 public: | 73 public: |
74 explicit KeyPair(EVP_PKEY* pub_key, EVP_PKEY* priv_key); | 74 explicit KeyPair(EVP_PKEY* pub_key, EVP_PKEY* priv_key); |
75 KeyPair(const KeyPair& other); | 75 KeyPair(const KeyPair& other); |
76 void operator=(const KeyPair& other); | 76 void operator=(const KeyPair& other); |
77 ~KeyPair(); | 77 ~KeyPair(); |
78 | 78 |
79 EVP_PKEY* public_key; | 79 crypto::ScopedEVP_PKEY public_key; |
80 EVP_PKEY* private_key; | 80 crypto::ScopedEVP_PKEY private_key; |
81 | 81 |
82 private: | 82 private: |
83 KeyPair(); // intentionally not implemented. | 83 KeyPair(); // intentionally not implemented. |
84 }; | 84 }; |
85 | 85 |
86 // Returns the index of the keypair for |public_key|. or -1 if not found. | 86 // Returns the index of the keypair for |public_key|. or -1 if not found. |
87 int FindKeyPairIndex(EVP_PKEY* public_key); | 87 int FindKeyPairIndex(EVP_PKEY* public_key); |
88 | 88 |
89 std::vector<KeyPair> pairs_; | 89 std::vector<KeyPair> pairs_; |
90 | 90 |
91 friend struct DefaultSingletonTraits<OpenSSLClientKeyStore>; | 91 friend struct DefaultSingletonTraits<OpenSSLClientKeyStore>; |
92 | 92 |
93 DISALLOW_COPY_AND_ASSIGN(OpenSSLClientKeyStore); | 93 DISALLOW_COPY_AND_ASSIGN(OpenSSLClientKeyStore); |
94 }; | 94 }; |
95 | 95 |
96 } // namespace net | 96 } // namespace net |
97 | 97 |
98 #endif // NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_ | 98 #endif // NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_ |
OLD | NEW |