pyctr.type.save.common module
- exception pyctr.type.save.common.PartitionContainerError[source]
Bases:
PyCTRErrorGeneric error for partition container operations.
- exception pyctr.type.save.common.InvalidPartitionContainerError[source]
Bases:
PartitionContainerErrorThere is an error with the header, such as a missing magic.
- exception pyctr.type.save.common.CorruptPartitionError[source]
Bases:
PartitionContainerErrorA hash somewhere in the header is incorrect.
- class pyctr.type.save.common.PartitionContainerBase(file, mode='rb', *, fs=None, closefd=None, crypto=None, dev=False, cmac_base=None, sd_key_file=None, sd_key=None)[source]
Bases:
TypeReaderCryptoBaseBase class for the DISA and DIFF classes.
This object is not to be manually created. Please use the
DISAorDIFFclasses.- Parameters:
file (FilePathOrObject) – A file path or a file-like object with the DISA or DIFF data.
mode (ReadWriteBinaryFileModes) – Mode to open the file with, passed to open. Only used if a file path was given.
closefd (bool | None) – Close the underlying file object when closed. Defaults to True for file paths, and False for file-like objects.
crypto (CryptoEngine) – A custom
CryptoEngineobject to be used. Defaults to None, which causes a new one to be created.dev (bool) – Use devunit keys.
cmac_base (CMACTypeBase) – A
CMACTypeBaseobject that describes how to update the CMAC.sd_key_file (FilePath) – Path to a movable.sed file to load the SD KeyY from.
sd_key (bytes) – SD KeyY to use. Has priority over sd_key_file if both are specified.
fs (FS | None)