koi_net.components.secure_manager
Classes
|
Subsystem handling secure protocol logic. |
- class koi_net.components.secure_manager.SecureManager(log, identity, cache, config, root_dir)[source]
Bases:
objectSubsystem handling secure protocol logic.
- Parameters:
log (Logger)
identity (NodeIdentity)
cache (Cache)
config (ConfigProvider | BaseNodeConfig)
root_dir (Path)
- cache: Cache
- config: ConfigProvider | BaseNodeConfig
- create_envelope(payload, target)[source]
Returns signed envelope to target from provided payload.
- Return type:
- Parameters:
payload (ApiModels)
target (KoiNetNode)
- handle_unknown_node(envelope)[source]
Attempts to find node profile in proided envelope.
If an unknown node sends an envelope, it may still be able to be validated if that envelope contains their node profile. This is essential for allowing unknown nodes to handshake and introduce themselves. Only an EventsPayload contain a NEW event for a node profile for the source node is permissible.
- Return type:
Bundle|None- Parameters:
envelope (SignedEnvelope)
- identity: NodeIdentity
- log: Logger
- property pem_path: Path
- priv_key: PrivateKey
- root_dir: Path
- validate_envelope(envelope)[source]
Validates signed envelope from another node.
- Parameters:
envelope (SignedEnvelope)