2021-02-04 21:46:03 +03:00
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
// Licensed under the Apache 2.0 License.
|
|
|
|
|
|
|
|
#pragma once
|
2022-02-11 12:35:38 +03:00
|
|
|
#include "ccf/ds/json.h"
|
2021-02-04 21:46:03 +03:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace ccf
|
|
|
|
{
|
|
|
|
enum class QuoteFormat
|
|
|
|
{
|
2022-08-05 10:54:51 +03:00
|
|
|
oe_sgx_v1 = 0,
|
|
|
|
insecure_virtual = 1,
|
|
|
|
amd_sev_snp_v1 = 2
|
2021-02-04 21:46:03 +03:00
|
|
|
};
|
|
|
|
|
2022-08-05 10:54:51 +03:00
|
|
|
DECLARE_JSON_ENUM(
|
|
|
|
QuoteFormat,
|
|
|
|
{{QuoteFormat::oe_sgx_v1, "OE_SGX_v1"},
|
|
|
|
{QuoteFormat::insecure_virtual, "Insecure_Virtual"},
|
|
|
|
{QuoteFormat::amd_sev_snp_v1, "AMD_SEV_SNP_v1"}})
|
2021-02-04 21:46:03 +03:00
|
|
|
|
|
|
|
struct QuoteInfo
|
|
|
|
{
|
2021-04-14 21:45:27 +03:00
|
|
|
/// Quote format
|
2021-02-04 21:46:03 +03:00
|
|
|
QuoteFormat format = QuoteFormat::oe_sgx_v1;
|
2021-04-14 21:45:27 +03:00
|
|
|
/// Enclave quote
|
2021-02-04 21:46:03 +03:00
|
|
|
std::vector<uint8_t> quote;
|
2021-04-14 21:45:27 +03:00
|
|
|
/// Quote endorsements
|
2021-02-04 21:46:03 +03:00
|
|
|
std::vector<uint8_t> endorsements;
|
|
|
|
};
|
|
|
|
|
|
|
|
DECLARE_JSON_TYPE(QuoteInfo);
|
|
|
|
DECLARE_JSON_REQUIRED_FIELDS(QuoteInfo, format, quote, endorsements);
|
|
|
|
}
|