tpm2_protocol/message/
duplication.rs1use crate::{
9 data::{
10 Tpm2bData, Tpm2bEncryptedSecret, Tpm2bName, Tpm2bPrivate, Tpm2bPublic, TpmCc, TpmtSymDef,
11 TpmtSymDefObject,
12 },
13 tpm_struct,
14};
15use core::fmt::Debug;
16
17tpm_struct! {
18 #[derive(Debug, PartialEq, Eq, Clone)]
19 kind: Command,
20 name: TpmDuplicateCommand,
21 cc: TpmCc::Duplicate,
22 handles: {
23 pub object_handle: crate::data::TpmiDhObject,
24 pub new_parent_handle: crate::data::TpmiDhObject,
25 },
26 parameters: {
27 pub encryption_key_in: Tpm2bData,
28 pub symmetric_alg: TpmtSymDefObject,
29 }
30}
31
32tpm_struct! {
33 #[derive(Debug, PartialEq, Eq, Clone)]
34 kind: Response,
35 name: TpmDuplicateResponse,
36 cc: TpmCc::Duplicate,
37 handles: {},
38 parameters: {
39 pub encryption_key_out: Tpm2bData,
40 pub duplicate: Tpm2bPrivate,
41 pub out_sym_seed: Tpm2bEncryptedSecret,
42 }
43}
44
45tpm_struct! {
46 #[derive(Debug, PartialEq, Eq, Clone)]
47 kind: Command,
48 name: TpmRewrapCommand,
49 cc: TpmCc::Rewrap,
50 handles: {
51 pub old_parent: crate::data::TpmiDhObject,
52 pub new_parent: crate::data::TpmiDhObject,
53 },
54 parameters: {
55 pub in_duplicate: Tpm2bPrivate,
56 pub name: Tpm2bName,
57 pub in_sym_seed: Tpm2bEncryptedSecret,
58 }
59}
60
61tpm_struct! {
62 #[derive(Debug, PartialEq, Eq, Clone)]
63 kind: Response,
64 name: TpmRewrapResponse,
65 cc: TpmCc::Rewrap,
66 handles: {},
67 parameters: {
68 pub out_duplicate: Tpm2bPrivate,
69 pub out_sym_seed: Tpm2bEncryptedSecret,
70 }
71}
72
73tpm_struct! {
74 #[derive(Debug, PartialEq, Eq, Clone)]
75 kind: Command,
76 name: TpmImportCommand,
77 cc: TpmCc::Import,
78 handles: {
79 pub parent_handle: crate::data::TpmiDhObject,
80 },
81 parameters: {
82 pub encryption_key: Tpm2bData,
83 pub object_public: Tpm2bPublic,
84 pub duplicate: Tpm2bPrivate,
85 pub in_sym_seed: Tpm2bEncryptedSecret,
86 pub symmetric_alg: TpmtSymDef,
87 }
88}
89
90tpm_struct! {
91 #[derive(Debug, Default, PartialEq, Eq, Clone)]
92 kind: Response,
93 name: TpmImportResponse,
94 cc: TpmCc::Import,
95 handles: {},
96 parameters: {
97 pub out_private: Tpm2bPrivate,
98 }
99}