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 #ifndef NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_
6 #define NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_
10 #include "net/quic/crypto/channel_id.h"
18 class ServerBoundCertService
;
20 class NET_EXPORT_PRIVATE ChannelIDKeyChromium
: public ChannelIDKey
{
22 explicit ChannelIDKeyChromium(crypto::ECPrivateKey
* ec_private_key
);
23 virtual ~ChannelIDKeyChromium();
25 // ChannelIDKey interface
26 virtual bool Sign(base::StringPiece signed_data
,
27 std::string
* out_signature
) const OVERRIDE
;
28 virtual std::string
SerializeKey() const OVERRIDE
;
31 scoped_ptr
<crypto::ECPrivateKey
> ec_private_key_
;
34 // ChannelIDSourceChromium implements the QUIC ChannelIDSource interface.
35 class ChannelIDSourceChromium
: public ChannelIDSource
{
37 explicit ChannelIDSourceChromium(
38 ServerBoundCertService
* server_bound_cert_service
);
39 virtual ~ChannelIDSourceChromium();
41 // ChannelIDSource interface
42 virtual QuicAsyncStatus
GetChannelIDKey(
43 const std::string
& hostname
,
44 scoped_ptr
<ChannelIDKey
>* channel_id_key
,
45 ChannelIDSourceCallback
* callback
) OVERRIDE
;
49 typedef std::set
<Job
*> JobSet
;
51 void OnJobComplete(Job
* job
);
53 // Set owning pointers to active jobs.
56 // The service for retrieving Channel ID keys.
57 ServerBoundCertService
* const server_bound_cert_service_
;
59 DISALLOW_COPY_AND_ASSIGN(ChannelIDSourceChromium
);
64 #endif // NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_