tpm2_protocol/message/
signing.rs1use crate::{
8 data::{Tpm2bDigest, TpmCc, TpmtSignature, TpmtTkHashcheck, TpmtTkVerified},
9 tpm_struct,
10};
11use core::fmt::Debug;
12
13tpm_struct! {
14 #[derive(Debug, PartialEq, Eq, Clone)]
15 kind: Command,
16 name: TpmSignCommand,
17 cc: TpmCc::Sign,
18 handles: {
19 pub key_handle: crate::data::TpmiDhObject,
20 },
21 parameters: {
22 pub digest: Tpm2bDigest,
23 pub in_scheme: TpmtSignature,
24 pub validation: TpmtTkHashcheck,
25 }
26}
27
28tpm_struct! {
29 #[derive(Debug, PartialEq, Eq, Clone)]
30 kind: Response,
31 name: TpmSignResponse,
32 cc: TpmCc::Sign,
33 handles: {},
34 parameters: {
35 pub signature: TpmtSignature,
36 }
37}
38
39tpm_struct! {
40 #[derive(Debug, PartialEq, Eq, Clone)]
41 kind: Command,
42 name: TpmVerifySignatureCommand,
43 cc: TpmCc::VerifySignature,
44 handles: {
45 pub key_handle: crate::data::TpmiDhObject,
46 },
47 parameters: {
48 pub digest: Tpm2bDigest,
49 pub signature: TpmtSignature,
50 }
51}
52
53tpm_struct! {
54 #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
55 kind: Response,
56 name: TpmVerifySignatureResponse,
57 cc: TpmCc::VerifySignature,
58 handles: {},
59 parameters: {
60 pub validation: TpmtTkVerified,
61 }
62}