1 // Copyright 2014 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.
5 #include "crypto/ec_private_key.h"
6 #include "net/ssl/channel_id_store.h"
10 ChannelIDStore::ChannelID::ChannelID() {
13 ChannelIDStore::ChannelID::ChannelID(const std::string
& server_identifier
,
14 base::Time creation_time
,
15 scoped_ptr
<crypto::ECPrivateKey
> key
)
16 : server_identifier_(server_identifier
),
17 creation_time_(creation_time
),
21 ChannelIDStore::ChannelID::ChannelID(const ChannelID
& other
)
22 : server_identifier_(other
.server_identifier_
),
23 creation_time_(other
.creation_time_
),
24 key_(other
.key_
? other
.key_
->Copy() : nullptr) {
27 ChannelIDStore::ChannelID
& ChannelIDStore::ChannelID::operator=(
28 const ChannelID
& other
) {
31 server_identifier_
= other
.server_identifier_
;
32 creation_time_
= other
.creation_time_
;
34 key_
.reset(other
.key_
->Copy());
38 ChannelIDStore::ChannelID::~ChannelID() {}
40 void ChannelIDStore::InitializeFrom(const ChannelIDList
& list
) {
41 for (ChannelIDList::const_iterator i
= list
.begin(); i
!= list
.end();
43 SetChannelID(scoped_ptr
<ChannelID
>(new ChannelID(*i
)));