tpm2_protocol/message/
attestation.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2// Copyright (c) 2025 Opinsys Oy
3// Copyright (c) 2024-2025 Jarkko Sakkinen
4
5//! 18 Attestation Commands
6
7use crate::{
8    data::{Tpm2bAttest, Tpm2bData, Tpm2bDigest, TpmCc, TpmtSignature, TpmtTkCreation},
9    tpm_response, tpm_struct,
10};
11use core::fmt::Debug;
12
13tpm_struct! {
14    #[derive(Debug, PartialEq, Eq, Clone)]
15    TpmCertifyCommand,
16    TpmCc::Certify,
17    false,
18    true,
19    2,
20    {
21        pub qualifying_data: Tpm2bData,
22        pub in_scheme: TpmtSignature,
23    }
24}
25tpm_response! {
26    #[derive(Debug, PartialEq, Eq, Clone)]
27    TpmCertifyResponse,
28    TpmCc::Certify,
29    false,
30    true,
31    {
32        pub certify_info: Tpm2bAttest,
33        pub signature: TpmtSignature,
34    }
35}
36
37tpm_struct! {
38    #[derive(Debug, PartialEq, Eq, Clone)]
39    TpmCertifyCreationCommand,
40    TpmCc::CertifyCreation,
41    false,
42    true,
43    2,
44    {
45        pub qualifying_data: Tpm2bData,
46        pub creation_hash: Tpm2bDigest,
47        pub in_scheme: TpmtSignature,
48        pub creation_ticket: TpmtTkCreation,
49    }
50}
51
52tpm_response! {
53    #[derive(Debug, PartialEq, Eq, Clone)]
54    TpmCertifyCreationResponse,
55    TpmCc::CertifyCreation,
56    false,
57    true,
58    {
59        pub certify_info: Tpm2bAttest,
60        pub signature: TpmtSignature,
61    }
62}
63
64tpm_struct! {
65    #[derive(Debug, PartialEq, Eq, Clone)]
66    TpmGetSessionAuditDigestCommand,
67    TpmCc::GetSessionAuditDigest,
68    false,
69    true,
70    3,
71    {
72        pub qualifying_data: Tpm2bData,
73        pub in_scheme: TpmtSignature,
74    }
75}
76
77tpm_response! {
78    #[derive(Debug, PartialEq, Eq, Clone)]
79    TpmGetSessionAuditDigestResponse,
80    TpmCc::GetSessionAuditDigest,
81    false,
82    true,
83    {
84        pub audit_info: Tpm2bAttest,
85        pub signature: TpmtSignature,
86    }
87}
88
89tpm_struct! {
90    #[derive(Debug, PartialEq, Eq, Clone)]
91    TpmGetCommandAuditDigestCommand,
92    TpmCc::GetCommandAuditDigest,
93    false,
94    true,
95    2,
96    {
97        pub qualifying_data: Tpm2bData,
98        pub in_scheme: TpmtSignature,
99    }
100}
101
102tpm_response! {
103    #[derive(Debug, PartialEq, Eq, Clone)]
104    TpmGetCommandAuditDigestResponse,
105    TpmCc::GetCommandAuditDigest,
106    false,
107    true,
108    {
109        pub audit_info: Tpm2bAttest,
110        pub signature: TpmtSignature,
111    }
112}
113
114tpm_struct! {
115    #[derive(Debug, PartialEq, Eq, Clone)]
116    TpmGetTimeCommand,
117    TpmCc::GetTime,
118    false,
119    true,
120    2,
121    {
122        pub qualifying_data: Tpm2bData,
123        pub in_scheme: TpmtSignature,
124    }
125}
126
127tpm_response! {
128    #[derive(Debug, PartialEq, Eq, Clone)]
129    TpmGetTimeResponse,
130    TpmCc::GetTime,
131    false,
132    true,
133    {
134        pub time_info: Tpm2bAttest,
135        pub signature: TpmtSignature,
136    }
137}