proxygen
Utils.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #pragma once
10 
12 
13 namespace fizz {
14 namespace extensions {
15 
17  public:
18  static constexpr uint8_t kP256EcKeySize = 64;
19 
21  const TokenBindingType& type,
22  const TokenBindingKeyParameters& keyParams,
23  const Buf& ekm) {
24  Buf concatenatedBuf = folly::IOBuf::create(
26  sizeof(TokenBindingType));
27  folly::io::Appender appender(concatenatedBuf.get(), 20);
28 
29  detail::write(type, appender);
30  detail::write(keyParams, appender);
31  appender.push(ekm->coalesce());
32  return concatenatedBuf;
33  }
34 };
35 } // namespace extensions
36 } // namespace fizz
static Buf constructMessage(const TokenBindingType &type, const TokenBindingKeyParameters &keyParams, const Buf &ekm)
Definition: Utils.h:20
void write(const T &in, folly::io::Appender &appender)
Definition: Types-inl.h:112
static std::unique_ptr< IOBuf > create(std::size_t capacity)
Definition: IOBuf.cpp:229
PskType type
static constexpr uint8_t kP256EcKeySize
Definition: Utils.h:18
TokenBindingKeyParameters
Definition: Types.h:33
constexpr uint8_t kTokenBindingEkmSize
Definition: Types.h:18
Definition: Actions.h:16
std::unique_ptr< folly::IOBuf > Buf
Definition: Types.h:22