CCF
Loading...
Searching...
No Matches
signatures.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
5#include "ccf/service/map.h"
6#include "node_signature.h"
7
8#include <string>
9#include <vector>
10
11namespace ccf
12{
14 {
19 // DEPRECATED: These are no longer populated, and will always be 0
26
28
29 PrimarySignature(const ccf::NodeId& node_, ccf::SeqNo seqno_) :
30 NodeSignature(node_),
31 seqno(seqno_)
32 {}
33
35
37 const ccf::NodeId& node_,
38 ccf::SeqNo seqno_,
39 ccf::View view_,
40 const ccf::crypto::Sha256Hash root_,
41 Nonce hashed_nonce_,
42 const std::vector<uint8_t>& sig_,
43 const ccf::crypto::Pem& cert_) :
44 NodeSignature(sig_, node_, hashed_nonce_),
45 seqno(seqno_),
46 view(view_),
47 root(root_),
48 cert(cert_)
49 {}
50 };
56
57 // Most recent signature is a single Value in the KV
59
60 // Serialised Merkle tree at most recent signature is a single Value in the KV
62 ccf::kv::RawCopySerialisedValue<std::vector<uint8_t>>;
63
64 using CoseSignature = std::vector<uint8_t>;
65
66 // Most recent COSE signature is a single Value in the KV
68
69 namespace Tables
70 {
71 static constexpr auto SIGNATURES = "public:ccf.internal.signatures";
72 static constexpr auto COSE_SIGNATURES =
73 "public:ccf.internal.cose_signatures";
74 static constexpr auto SERIALISED_MERKLE_TREE = "public:ccf.internal.tree";
75 }
76}
Definition pem.h:18
Definition sha256_hash.h:16
Definition value.h:32
#define DECLARE_JSON_TYPE_WITH_BASE_AND_OPTIONAL_FIELDS(TYPE, BASE)
Definition json.h:702
#define DECLARE_JSON_REQUIRED_FIELDS(TYPE,...)
Definition json.h:714
#define DECLARE_JSON_OPTIONAL_FIELDS(TYPE,...)
Definition json.h:786
Definition app_interface.h:14
std::vector< uint8_t > CoseSignature
Definition signatures.h:64
view
Definition signatures.h:54
commit_seqno
Definition signatures.h:54
commit_view
Definition signatures.h:54
seqno
Definition signatures.h:54
uint64_t View
Definition tx_id.h:23
uint64_t SeqNo
Definition tx_id.h:36
STL namespace.
Definition node_signature.h:15
Definition signatures.h:14
ccf::View view
View of the signature transaction.
Definition signatures.h:18
PrimarySignature(const ccf::crypto::Sha256Hash &root_)
Definition signatures.h:34
ccf::crypto::Sha256Hash root
Root of the Merkle Tree as of seqno - 1.
Definition signatures.h:23
PrimarySignature(const ccf::NodeId &node_, ccf::SeqNo seqno_, ccf::View view_, const ccf::crypto::Sha256Hash root_, Nonce hashed_nonce_, const std::vector< uint8_t > &sig_, const ccf::crypto::Pem &cert_)
Definition signatures.h:36
ccf::SeqNo commit_seqno
Definition signatures.h:20
ccf::View commit_view
Definition signatures.h:21
PrimarySignature(const ccf::NodeId &node_, ccf::SeqNo seqno_)
Definition signatures.h:29
ccf::SeqNo seqno
Sequence number of the signature transaction.
Definition signatures.h:16
ccf::crypto::Pem cert
Service-endorsed certificate of the node which produced the signature.
Definition signatures.h:25
PrimarySignature()
Definition signatures.h:27