Skip to main content

KeyMessage

Overview

KeyMessage is a typed dictionary representing a complete key message received from or sent to the KeySquare platform. It encapsulates both general and key-specific header information for each message.

Definition

from typing import TypedDict

class KeyMessage(TypedDict):
"""
Represents a complete key message.

Attributes:
header: General header information
keyHeader: Key-specific header information
"""
header: Header
keyHeader: KeyHeader

Attributes

At a minimum all KeyMessages will contain the following attributes:

  • header: General header information for the message. See Header for details on the header fields and types.
  • keyHeader: Key-specific header information. See KeyHeader for details on the key header fields and types.

Usage Example

from keysquarepy import KeyMessage

def handle_message(msg: KeyMessage):
print(f"Header: {msg['header']}")
print(f"KeyHeader: {msg['keyHeader']}")

See Also