CCF
Loading...
Searching...
No Matches
snp_ioctl.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
6
7namespace ccf::pal::snp
8{
9 static inline bool supports_sev_snp()
10 {
11 return ioctl6::supports_sev_snp();
12 }
13
14 static std::unique_ptr<AttestationInterface> get_attestation(
15 const PlatformAttestationReportData& report_data)
16 {
17 if (ioctl6::supports_sev_snp())
18 {
19 return std::make_unique<ioctl6::Attestation>(report_data);
20 }
21 else
22 {
23 throw std::logic_error("SEV-SNP not supported");
24 }
25 }
26
27 static std::unique_ptr<ioctl6::DerivedKey> make_derived_key(
28 const TcbVersionRaw version = {})
29 {
30 if (ioctl6::supports_sev_snp())
31 {
32 return std::make_unique<ioctl6::DerivedKey>(version);
33 }
34 throw std::logic_error("SEV-SNP Derived key not supported");
35 }
36};
Definition attestation_sev_snp.h:24