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

Side by Side Diff: net/base/openssl_private_key_store_memory.cc

Issue 12220104: Wire up SSL client authentication for OpenSSL/Android through the net/ stack (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 10 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
OLDNEW
(Empty)
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.
4
5 // Defines an in-memory private key store, primarily used for testing.
6
7 #include "net/base/openssl_private_key_store.h"
8
9 #include "base/logging.h"
10 #include "base/memory/singleton.h"
11 #include "base/synchronization/lock.h"
12 #include "net/base/x509_certificate.h"
13
14 namespace net {
15
16 namespace {
17
18 // OpenSSLPrivateKeyStoreMemory is an OpenSSL private key store that
19 // does not make use of any Android APIs, making it suitable
20 // for use when using OpenSSL on non-Android platforms (eg:
21 // for testing purposes).
22 class OpenSSLPrivateKeyStoreMemory : public OpenSSLPrivateKeyStore {
23 public:
24 OpenSSLPrivateKeyStoreMemory() {}
25
26 static OpenSSLPrivateKeyStoreMemory* GetInstance() {
27 return Singleton<OpenSSLPrivateKeyStoreMemory>::get();
28 }
29
30 virtual bool StoreKeyPair(const GURL& url, EVP_PKEY* pkey) OVERRIDE {
31 // Since there is no real key store, just record the keys in
32 // memory.
33 AddKeyPair(pkey, pkey);
34 return true;
Ryan Sleevi 2013/02/25 19:51:07 DESIGN: This seems to violate what your base class
digit1 2013/02/26 11:03:13 Thanks, I've remove the AddKeyPair() entirely.
35 }
36
37 private:
38 DISALLOW_COPY_AND_ASSIGN(OpenSSLPrivateKeyStoreMemory);
39 };
40
41 } // namespace
42
43 // static
44 OpenSSLPrivateKeyStore* OpenSSLPrivateKeyStore::GetInstance() {
45 return OpenSSLPrivateKeyStoreMemory::GetInstance();
46 }
47
48 } // namespace net
49
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698