proxygen
Validator.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 
13 #include <fizz/record/Types.h>
14 
15 namespace fizz {
16 namespace extensions {
17 
18 /*
19  * validateTokenBinding verifies the signature passed in with tokenBinding
20  * If verification succeeds, the TokenBindingID associated with the signature is
21  * returned. On verification failure, folly::none is returned
22  */
23 
24 class Validator {
25  public:
28  const Buf& ekm,
29  const TokenBindingKeyParameters& negotiatedParameters);
30 
31  private:
32  static void verify(
33  const TokenBindingKeyParameters& keyParams,
34  const Buf& key,
35  const Buf& signature,
36  const Buf& message);
37 
38  static folly::ssl::EcdsaSigUniquePtr constructECDSASig(const Buf& signature);
39 
41 };
42 } // namespace extensions
43 } // namespace fizz
Definition: test.c:42
static folly::ssl::EcKeyUniquePtr constructEcKeyFromBuf(const Buf &key)
Definition: Validator.cpp:108
static void verify(const TokenBindingKeyParameters &keyParams, const Buf &key, const Buf &signature, const Buf &message)
Definition: Validator.cpp:51
static folly::ssl::EcdsaSigUniquePtr constructECDSASig(const Buf &signature)
Definition: Validator.cpp:79
TokenBindingKeyParameters
Definition: Types.h:33
std::unique_ptr< ECDSA_SIG, EcdsaSigDeleter > EcdsaSigUniquePtr
std::unique_ptr< EC_KEY, EcKeyDeleter > EcKeyUniquePtr
Definition: Actions.h:16
StringPiece tokenBinding
static folly::Optional< TokenBindingID > validateTokenBinding(TokenBinding tokenBinding, const Buf &ekm, const TokenBindingKeyParameters &negotiatedParameters)
Definition: Validator.cpp:22
std::unique_ptr< folly::IOBuf > Buf
Definition: Types.h:22