diff --git a/src/controller/python/chip/CertificateAuthority.py b/src/controller/python/chip/CertificateAuthority.py index a49b1090d80d6e..0f63951f4d44e4 100644 --- a/src/controller/python/chip/CertificateAuthority.py +++ b/src/controller/python/chip/CertificateAuthority.py @@ -58,7 +58,7 @@ def _Handle(cls): def logger(cls): return logging.getLogger('CertificateAuthority') - def __init__(self, chipStack: ChipStack.ChipStack, caIndex: int, persistentStorage: PersistentStorage = None): + def __init__(self, chipStack: ChipStack.ChipStack, caIndex: int, persistentStorage: Optional[PersistentStorage] = None): ''' Initializes the CertificateAuthority. This will set-up the associated C++ OperationalCredentialsAdapter as well. @@ -200,14 +200,6 @@ def adminList(self) -> list[FabricAdmin.FabricAdmin]: def maximizeCertChains(self) -> bool: return self._maximizeCertChains - @property - def alwaysOmitIcac(self) -> bool: - return self._alwaysOmitIcac - - @property - def certificateValidityPeriodSec(self) -> int: - return self._certificateValidityPeriodSec - @maximizeCertChains.setter def maximizeCertChains(self, enabled: bool): self._chipStack.Call( @@ -216,6 +208,10 @@ def maximizeCertChains(self, enabled: bool): self._maximizeCertChains = enabled + @property + def alwaysOmitIcac(self) -> bool: + return self._alwaysOmitIcac + @alwaysOmitIcac.setter def alwaysOmitIcac(self, enabled: bool): self._chipStack.Call( @@ -224,6 +220,10 @@ def alwaysOmitIcac(self, enabled: bool): self._alwaysOmitIcac = enabled + @property + def certificateValidityPeriodSec(self) -> int: + return self._certificateValidityPeriodSec + @certificateValidityPeriodSec.setter def certificateValidityPeriodSec(self, validity: int): if validity < 0: @@ -250,13 +250,14 @@ def _Handle(cls): def logger(cls): return logging.getLogger('CertificateAuthorityManager') - def __init__(self, chipStack: ChipStack.ChipStack, persistentStorage: PersistentStorage = None): + def __init__(self, chipStack: ChipStack.ChipStack, persistentStorage: Optional[PersistentStorage] = None): ''' Initializes the manager. chipStack: Reference to a chip.ChipStack object that is used to initialize CertificateAuthority instances. - persistentStorage: If provided, over-rides the default instance in the provided chipStack + persistentStorage: An optional reference to persistentStorage, if provided, + over-rides the default instance in the provided chipStack when initializing CertificateAuthority instances. ''' self._chipStack = chipStack diff --git a/src/controller/python/chip/FabricAdmin.py b/src/controller/python/chip/FabricAdmin.py index 09b1b381ac6496..b44131a2c46352 100644 --- a/src/controller/python/chip/FabricAdmin.py +++ b/src/controller/python/chip/FabricAdmin.py @@ -64,7 +64,7 @@ def __init__(self, certificateAuthority: CertificateAuthority.CertificateAuthori self._activeControllers: List[ChipDeviceCtrl.ChipDeviceController] = [] def NewController(self, nodeId: Optional[int] = None, paaTrustStorePath: str = "", - useTestCommissioner: bool = False, catTags: List[int] = [], keypair: p256keypair.P256Keypair = None, + useTestCommissioner: bool = False, catTags: List[int] = [], keypair: Optional[p256keypair.P256Keypair] = None, dacRevocationSetPath: str = ""): ''' Create a new chip.ChipDeviceCtrl.ChipDeviceController instance on this fabric.