proxygen
fizz::extensions::test::TokenBindingConstructorTest Class Reference
Inheritance diagram for fizz::extensions::test::TokenBindingConstructorTest:
testing::Test

Public Member Functions

void SetUp () override
 
Buf getBuf (StringPiece hex)
 
- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
virtual ~Test ()
 
virtual ~Test ()
 

Public Attributes

EvpPkeyUniquePtr key_
 

Additional Inherited Members

- Public Types inherited from testing::Test
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
- Static Public Member Functions inherited from testing::Test
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void TearDown ()
 

Detailed Description

Definition at line 27 of file TokenBindingConstructorTest.cpp.

Member Function Documentation

Buf fizz::extensions::test::TokenBindingConstructorTest::getBuf ( StringPiece  hex)
inline

Definition at line 44 of file TokenBindingConstructorTest.cpp.

References folly::IOBuf::copyBuffer(), folly::data(), and folly::unhexlify().

44  {
45  auto data = unhexlify(hex);
46  return folly::IOBuf::copyBuffer(data.data(), data.size());
47  }
bool unhexlify(const InputString &input, OutputString &output)
Definition: String-inl.h:616
static std::unique_ptr< IOBuf > copyBuffer(const void *buf, std::size_t size, std::size_t headroom=0, std::size_t minTailroom=0)
Definition: IOBuf.h:1587
static constexpr uint64_t data[1]
Definition: Fingerprint.cpp:43
void fizz::extensions::test::TokenBindingConstructorTest::SetUp ( )
inlineoverridevirtual

Reimplemented from testing::Test.

Definition at line 29 of file TokenBindingConstructorTest.cpp.

29  {
30  OpenSSL_add_all_algorithms();
31  EcKeyUniquePtr ecKey(EC_KEY_new_by_curve_name(NID_X9_62_prime256v1));
32  key_ = EvpPkeyUniquePtr(EVP_PKEY_new());
33  if (!ecKey || !key_) {
34  throw std::runtime_error("Unable to initialize key");
35  }
36  if (EC_KEY_generate_key(ecKey.get()) != 1) {
37  throw std::runtime_error("Unable to generate EC Key");
38  }
39  if (EVP_PKEY_set1_EC_KEY(key_.get(), ecKey.get()) != 1) {
40  throw std::runtime_error("Unable to set EC key");
41  }
42  }
std::unique_ptr< EVP_PKEY, EvpPkeyDeleter > EvpPkeyUniquePtr
std::unique_ptr< EC_KEY, EcKeyDeleter > EcKeyUniquePtr

Member Data Documentation

EvpPkeyUniquePtr fizz::extensions::test::TokenBindingConstructorTest::key_

Definition at line 49 of file TokenBindingConstructorTest.cpp.


The documentation for this class was generated from the following file: