CCF
Loading...
Searching...
No Matches
signed_req.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
6#include "ccf/ds/json.h"
7
8#include <vector>
9
10namespace ccf
11{
12 struct SignedReq
13 {
15 std::vector<uint8_t> sig = {};
16
18 std::vector<uint8_t> req = {};
19
21 std::vector<uint8_t> request_body = {};
22
25
27 std::string key_id = {};
28
29 bool operator==(const SignedReq& other) const
30 {
31 return (sig == other.sig) && (req == other.req) && (md == other.md) &&
32 (request_body == other.request_body) && (key_id == other.key_id);
33 }
34
35 bool operator!=(const SignedReq& other) const
36 {
37 return !(*this == other);
38 }
39 };
40 DECLARE_JSON_TYPE(SignedReq)
41 DECLARE_JSON_REQUIRED_FIELDS(SignedReq, sig, req, request_body, md, key_id)
42}
#define DECLARE_JSON_REQUIRED_FIELDS(TYPE,...)
Definition json.h:714
#define DECLARE_JSON_TYPE(TYPE)
Definition json.h:663
MDType
Definition md_type.h:10
Definition app_interface.h:14
Definition signed_req.h:13
std::string key_id
Signer key id, if present in the request.
Definition signed_req.h:27
std::vector< uint8_t > sig
Signature.
Definition signed_req.h:15
ccf::crypto::MDType md
Hashing algorithm used to summarise content before signature.
Definition signed_req.h:24
bool operator==(const SignedReq &other) const
Definition signed_req.h:29
std::vector< uint8_t > request_body
Request body.
Definition signed_req.h:21
std::vector< uint8_t > req
Signed content.
Definition signed_req.h:18
bool operator!=(const SignedReq &other) const
Definition signed_req.h:35