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#pragma once
4
5#include <cstdint>
6#include <span>
7#include <variant>
8#include <vector>
9
11{
12 namespace pos
13 {
14 struct InArray
15 {};
16
17 struct AtKey
18 {
20 int64_t key;
21 };
22
23 using Type = std::variant<InArray, AtKey>;
24 }
25
26 namespace desc
27 {
28 struct Empty
29 {};
30
31 struct Value
32 {
36 int64_t key;
38 const std::vector<uint8_t>& value;
39 };
40
41 using Type = std::variant<Empty, Value>;
42 }
43
56 std::vector<uint8_t> set_unprotected_header(
57 const std::span<const uint8_t>& cose_input, const desc::Type& descriptor);
58}
std::variant< Empty, Value > Type
Definition cose.h:41
std::variant< InArray, AtKey > Type
Definition cose.h:23
Definition cose.h:11
std::vector< uint8_t > set_unprotected_header(const std::span< const uint8_t > &cose_input, const desc::Type &descriptor)
Definition cose.cpp:14
Definition cose.h:29
Definition cose.h:32
int64_t key
The top-level key at which to insert the value.
Definition cose.h:36
const std::vector< uint8_t > & value
The value to insert in the unprotected header.
Definition cose.h:38
pos::Type position
The type of position at which to insert the value.
Definition cose.h:34
Definition cose.h:18
int64_t key
The sub-key at which to insert the value.
Definition cose.h:20
Definition cose.h:15