OLD | NEW |
(Empty) | |
| 1 |
| 2 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. |
| 5 |
| 6 #include "google_apis/cup/client_update_protocol.h" |
| 7 |
| 8 #include "base/logging.h" |
| 9 |
| 10 class OpenSSLCupKeyImpl : public ClientUpdateProtocol::CupKeyImpl { |
| 11 public: |
| 12 OpenSSLCupKeyImpl(); |
| 13 virtual ~OpenSSLCupKeyImpl(); |
| 14 |
| 15 virtual size_t PublicKeyLength() const OVERRIDE; |
| 16 virtual std::vector<uint8> EncryptKeySource( |
| 17 const std::vector<uint8>& key_source) OVERRIDE; |
| 18 |
| 19 bool LoadPublicKey(const base::StringPiece& public_key); |
| 20 }; |
| 21 |
| 22 OpenSSLCupKeyImpl::OpenSSLCupKeyImpl() { |
| 23 NOTIMPLEMENTED(); |
| 24 } |
| 25 |
| 26 OpenSSLCupKeyImpl::~OpenSSLCupKeyImpl() { |
| 27 NOTIMPLEMENTED(); |
| 28 } |
| 29 |
| 30 bool OpenSSLCupKeyImpl::LoadPublicKey( |
| 31 const base::StringPiece& public_key) { |
| 32 NOTIMPLEMENTED(); |
| 33 return false; |
| 34 } |
| 35 |
| 36 size_t OpenSSLCupKeyImpl::PublicKeyLength() const { |
| 37 NOTIMPLEMENTED(); |
| 38 return 0; |
| 39 } |
| 40 |
| 41 std::vector<uint8> OpenSSLCupKeyImpl::EncryptKeySource( |
| 42 const std::vector<uint8>& key_source) { |
| 43 NOTIMPLEMENTED(); |
| 44 return std::vector<uint8>(); |
| 45 } |
| 46 |
| 47 ClientUpdateProtocol::CupKeyImpl* ClientUpdateProtocol::GetCupKeyImpl( |
| 48 const base::StringPiece& public_key) { |
| 49 scoped_ptr<OpenSSLCupKeyImpl> result(new OpenSSLCupKeyImpl()); |
| 50 if (!result.get()) |
| 51 return NULL; |
| 52 |
| 53 if (!result->LoadPublicKey(public_key)) |
| 54 return NULL; |
| 55 |
| 56 return result.release(); |
| 57 } |
| 58 |
OLD | NEW |