CCF
Loading...
Searching...
No Matches
secrets.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 "kv/kv_types.h"
7
8#include <vector>
9
10namespace ccf
11{
13 {
14 // Version at which the ledger secret is applicable from (recovery
15 // only)
16 std::optional<ccf::kv::Version> version;
17
18 // Encrypted secret for each backup
19 std::vector<uint8_t> encrypted_secret = {};
20
21 // Version at which the previous secret is stored at
22 std::optional<ccf::kv::Version> previous_secret_stored_version =
23 std::nullopt;
24 };
25
27 DECLARE_JSON_REQUIRED_FIELDS(EncryptedLedgerSecret, version, encrypted_secret)
29 EncryptedLedgerSecret, previous_secret_stored_version)
30
31 using EncryptedLedgerSecrets = std::vector<EncryptedLedgerSecret>;
32 using LedgerSecretsForNodes = std::map<NodeId, EncryptedLedgerSecrets>;
33
34 // This map is used to broadcast encrypted ledger secrets to all nodes, during
35 // recovery (past secrets) and re-keying (new secret)
37 namespace Tables
38 {
39 static constexpr auto ENCRYPTED_LEDGER_SECRETS =
40 "public:ccf.internal.encrypted_ledger_secrets";
41 }
42}
Definition value.h:32
#define DECLARE_JSON_REQUIRED_FIELDS(TYPE,...)
Definition json.h:714
#define DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(TYPE)
Definition json.h:690
#define DECLARE_JSON_OPTIONAL_FIELDS(TYPE,...)
Definition json.h:786
Definition app_interface.h:14
std::map< NodeId, EncryptedLedgerSecrets > LedgerSecretsForNodes
Definition secrets.h:32
Definition map_serializers.h:11
STL namespace.
Definition secrets.h:13
std::vector< uint8_t > encrypted_secret
Definition secrets.h:19
std::optional< ccf::kv::Version > version
Definition secrets.h:16
std::optional< ccf::kv::Version > previous_secret_stored_version
Definition secrets.h:22