Tpm2 stream
tpm2_stream ¶
Module that contains utility classes to help marshal and un-marshal date to/from the TPM.
Tpm2StreamElement ¶
Tpm2StreamPrimitive ¶
Tpm2 Stream Primitive.
Attributes:
Name | Type | Description |
---|---|---|
size |
size of the primitive. 1, 2, 4, or 8 bytes |
|
value |
Value of primitive |
__init__ ¶
__init__(size: int, value: str) -> Tpm2StreamPrimitive
Init a primitive value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
1, 2, 4, or 8 bytes |
required |
value |
str
|
Value to stream. |
required |
marshal ¶
marshal() -> bytes
Serializes the Tpm2 primitive.
Returns:
Type | Description |
---|---|
str
|
string representing packed data as bytes (i.e. b'\x01\x00\x03') |
TPM2_COMMAND_HEADER ¶
Tpm2 Command header.
Attributes:
Name | Type | Description |
---|---|---|
tag |
The Tag |
|
code |
The Code |
|
size |
The size of the code |
marshal ¶
marshal() -> str
Serializes the Tpm2 command header.
Returns:
Type | Description |
---|---|
str
|
string representing packed data as bytes (i.e. b'\x01\x00\x03') |