CCF
Loading...
Searching...
No Matches
cose.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
4#pragma once
5
6#include <cstdint>
7#include <string>
8
9namespace ccf
10{
11 namespace cose
12 {
13 namespace header
14 {
15 namespace iana // https://www.iana.org/assignments/cose/cose.xhtml
16 {
17 static constexpr int64_t ALG = 1;
18 static constexpr int64_t CONTENT_TYPE = 3;
19 static constexpr int64_t KID = 4;
20 static constexpr int64_t CWT_CLAIMS = 15;
21 static constexpr int64_t X5CHAIN = 33;
22 static constexpr int64_t PREIMAGE_CONTENT_TYPE = 259;
23 static constexpr int64_t VDS = 395;
24 static constexpr int64_t VDP = 396;
25
26 // https://www.ietf.org/archive/id/draft-ietf-cose-merkle-tree-proofs-18.html#name-cose-header-parameter
27 static constexpr int64_t INCLUSION_PROOFS = -1;
28 }
29 namespace custom
30 {
31 static constexpr std::string_view CCF_V1 = "ccf.v1";
32 static constexpr std::string_view TX_ID = "txid";
33 static constexpr std::string_view TX_RANGE_BEGIN = "epoch.start.txid";
34 static constexpr std::string_view TX_RANGE_END = "epoch.end.txid";
35 static constexpr std::string_view EPOCH_LAST_MERKLE_ROOT =
36 "epoch.end.merkle.root";
37 }
38 }
39 namespace value
40 {
41 // https://www.ietf.org/archive/id/draft-birkholz-cose-receipts-ccf-profile-05.html#section-2
42 static constexpr int64_t CCF_LEDGER_SHA256 = 2;
43
44 static constexpr std::string_view CT_JSON = "application/json";
45 static constexpr std::string_view CT_OCTET_STREAM =
46 "application/octet-stream";
47 }
48 }
49 namespace cwt::header
50 {
51 namespace iana // https://www.iana.org/assignments/cwt/cwt.xhtml
52 {
53 static constexpr int64_t ISS = 1;
54 static constexpr int64_t SUB = 2;
55
56 /* Value is **PLAIN INTEGER**, as per
57 * https://www.rfc-editor.org/rfc/rfc8392#section-2. Quote:
58 *
59 * The "NumericDate" term in this specification has the same meaning and
60 * processing rules as the JWT "NumericDate" term defined in Section 2 of
61 * [RFC7519], except that it is represented as a CBOR numericdate (from
62 * Section 2.4.1 of [RFC7049]) instead of a JSON number. The encoding is
63 * modified so that the leading tag 1 (epoch-based date/time) MUST be
64 * omitted.
65 */
66 static constexpr int64_t IAT = 6;
67 }
68 namespace custom
69 {
70 static constexpr std::string_view SVN = "svn";
71 }
72 }
73}
Definition app_interface.h:13