Skip to content

Commit

Permalink
feat: add 1.6 security extension datatypes (#531)
Browse files Browse the repository at this point in the history
Add missing datatypes from 1.6 security extension whitepaper.
  • Loading branch information
proelke authored Nov 30, 2023
1 parent adcb37f commit 98a7d39
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change log


- [#531] (https://github.com/mobilityhouse/ocpp/pull/531) Add 1.6 security extension datatypes
=======
- [#528](https://github.com/mobilityhouse/ocpp/issues/528) v2.0.1 CertificateHashDataChainType childCertificateHashData requires the default of None
- [#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
Expand Down
43 changes: 43 additions & 0 deletions ocpp/v16/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
ChargingProfilePurposeType,
ChargingRateUnitType,
CiStringType,
HashAlgorithm,
Location,
Measurand,
Phase,
Expand Down Expand Up @@ -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
signing_certificate: str
install_date_time: 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

0 comments on commit 98a7d39

Please sign in to comment.