From f3176f1b969e7a10d4a67b223b0b79b386a0b935 Mon Sep 17 00:00:00 2001 From: Patrick Roelke Date: Tue, 14 Nov 2023 22:12:01 +0100 Subject: [PATCH 1/3] feat: add 1.6 security extension datatypes --- ocpp/v16/datatypes.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/ocpp/v16/datatypes.py b/ocpp/v16/datatypes.py index 1f249e477..ff45e6f61 100644 --- a/ocpp/v16/datatypes.py +++ b/ocpp/v16/datatypes.py @@ -7,6 +7,7 @@ ChargingProfilePurposeType, ChargingRateUnitType, CiStringType, + HashAlgorithm, Location, Measurand, Phase, @@ -121,3 +122,45 @@ class MeterValue: timestamp: str sampled_value: List[SampledValue] + + +# Security Extension + + +@dataclass +class CertificateHashData: + """ + CertificateHashDataType is used by: + DeleteCertificate.req, GetInstalledCertificateIds.conf + """ + + hash_algorithm: HashAlgorithm + issuer_name_hash: str + issuer_key_hash: str + serial_number: str + + +@dataclass +class Firmware: + """ + Represents a copy of the firmware that can be loaded/updated on the Charge Point. + FirmwareType is used by: SignedUpdateFirmware.req + """ + + location: str + retrieve_date_time: str + install_date_time: Optional[str] = None + signing_certificate: Optional[str] = None + signature: Optional[str] = None + + +@dataclass +class LogParameters: + """ + Class for detailed information the retrieval of logging entries. + LogParametersType is used by: GetLog.req + """ + + remote_location: str + oldest_timestamp: Optional[str] = None + latest_timestamp: Optional[str] = None From 8632a61cfcd1959fc9a2341f8359fcea83330ad9 Mon Sep 17 00:00:00 2001 From: Patrick Roelke Date: Wed, 15 Nov 2023 13:47:25 +0100 Subject: [PATCH 2/3] add CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6cd7bf26..b82dc3c2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change log - +- [#531] (https://github.com/mobilityhouse/ocpp/pull/531) +Add 1.6 security extension datatypes - [#510](https://github.com/mobilityhouse/ocpp/issues/510) v2.0.1 UnitOfMeasureType - Enums missing and update docstring to allow use for variableCharacteristics - [#508](https://github.com/mobilityhouse/ocpp/issues/508) Exception - OccurrenceConstraintViolationError doc string correction From d6b14fe8ff36f5cb2602befcdc1e6700d0168d03 Mon Sep 17 00:00:00 2001 From: Patrick Roelke Date: Wed, 15 Nov 2023 14:25:59 +0100 Subject: [PATCH 3/3] fix: fix incorrect type --- ocpp/v16/datatypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocpp/v16/datatypes.py b/ocpp/v16/datatypes.py index ff45e6f61..aa652f80d 100644 --- a/ocpp/v16/datatypes.py +++ b/ocpp/v16/datatypes.py @@ -149,8 +149,8 @@ class Firmware: location: str retrieve_date_time: str + signing_certificate: str install_date_time: Optional[str] = None - signing_certificate: Optional[str] = None signature: Optional[str] = None