CCF
Loading...
Searching...
No Matches
nodes.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
8#include "ccf/entity_id.h"
9#include "ccf/kv/map.h"
11#include "ccf/service/map.h"
13
14#include <string>
15#include <vector>
16
17namespace ccf
18{
22
23 namespace Tables
24 {
25 static constexpr auto NODES = "public:ccf.gov.nodes.info";
26 static constexpr auto NODE_ENDORSED_CERTIFICATES =
27 "public:ccf.gov.nodes.endorsed_certificates";
28 }
29
31 const std::vector<uint8_t>& node_pubk_der)
32 {
33 return ccf::crypto::Sha256Hash(node_pubk_der).hex_str();
34 }
35
37 const std::vector<uint8_t>& node_cert_der)
38 {
41 }
42
44 const ccf::crypto::KeyPairPtr& node_sign_kp)
45 {
46 return compute_node_id_from_pubk_der(node_sign_kp->public_key_der());
47 }
48}
Definition sha256_hash.h:16
std::string hex_str() const
Definition sha256_hash.cpp:61
Definition map.h:30
std::shared_ptr< KeyPair > KeyPairPtr
Definition key_pair.h:145
std::vector< uint8_t > public_key_der_from_cert(const std::vector< uint8_t > &der)
Definition verifier.cpp:43
TypedMap< K, V, ccf::kv::serialisers::BlitSerialiser< K >, ccf::kv::serialisers::BlitSerialiser< V > > RawCopySerialisedMap
Definition map.h:105
Definition app_interface.h:15
ccf::kv::RawCopySerialisedMap< NodeId, ccf::crypto::Pem > NodeEndorsedCertificates
Definition nodes.h:21
ServiceMap< NodeId, NodeInfo > Nodes
Definition nodes.h:19
NodeId compute_node_id_from_kp(const ccf::crypto::KeyPairPtr &node_sign_kp)
Definition nodes.h:43
NodeId compute_node_id_from_cert_der(const std::vector< uint8_t > &node_cert_der)
Definition nodes.h:36
NodeId compute_node_id_from_pubk_der(const std::vector< uint8_t > &node_pubk_der)
Definition nodes.h:30