pi_portal.modules.system.file_security.FileSecurity

class pi_portal.modules.system.file_security.FileSecurity(file_path: str)[source]

Bases: object

Methods to validate the authenticity of local file system content.

Parameters:

file_path (str) – The path to the local file.

__init__(file_path: str) None[source]
sha256(expected_hash: str) None[source]

Validate the sha256 digest of this file against an expected value.

Parameters:

expected_hash (str) – The expected sha256 digest.

Raises:

FileSecurityViolation