1 // Copyright 2015 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_P2P_QUIC_P2P_CRYPTO_CONFIG_H_
6 #define NET_QUIC_P2P_QUIC_P2P_CRYPTO_CONFIG_H_
10 #include "net/quic/crypto/crypto_protocol.h"
14 struct QuicCryptoNegotiatedParameters
;
16 // Crypto configuration for P2P sessions.
17 class NET_EXPORT QuicP2PCryptoConfig
{
19 // |shared_key| specifies a key that's used to generate crypto keys. The key
20 // must be exchanged out-of-bound when the P2P transport is negotiated.
21 QuicP2PCryptoConfig(const std::string
& shared_key
);
22 ~QuicP2PCryptoConfig();
24 void set_aead(QuicTag aead
) { aead_
= aead
; }
26 // Sets suffix for HKDF. E.g. can be channel name to make sure different
27 // channels use different encryption keys derived from the same |shared_key|.
29 void set_hkdf_input_suffix(const std::string
& hkdf_input_suffix
) {
30 hkdf_input_suffix_
= hkdf_input_suffix
;
33 bool GetNegotiatedParameters(Perspective perspective
,
34 QuicCryptoNegotiatedParameters
* out_params
);
37 QuicTag aead_
= kAESG
;
38 std::string shared_key_
;
39 std::string hkdf_input_suffix_
;
44 #endif // NET_QUIC_P2P_QUIC_P2P_CRYPTO_CONFIG_H_