Signed meter values and OCMF
How a signed meter reading travels from the meter to the driver: the Open Charge Metering Format of S.A.F.E. e.V. section by section, the SignedMeterValue of OCPP 2.0.1 and its configuration, German calibration law and transparency software, and what a verifier checks.
Why sign a meter reading
A driver pays for energy that a meter counted, but the number reaches the bill through the charger controller, the backend and often a roaming partner. Any of them could change it. A signed reading closes that gap: the meter, or a signing unit next to it, signs the value with a private key that never leaves it, and anyone with the matching public key can later check that the value is the one the meter produced. Energy metering and signed meter values covers where the meter sits and how its readings reach the car.
German calibration law and transparency software
- In Germany, charging billed by energy falls under the Mess- und Eichgesetz (MessEG) and the Mess- und Eichverordnung (MessEV). The charge point as a whole is the measuring system, and its conformity is assessed before it is sold.
- The public key of the signing unit is shown on the charger, so the driver can compare it with the key in the data.
- The signed readings reach the driver with the bill, and transparency software checks them. S.A.F.E. e.V. publishes such software (transparenz.software); Chargy is an open source alternative whose README names chargeIT mobility as the party that provides its certification at the PTB.
Which PTB requirements and VDE application rules apply to a given charger, and the transition rules for older chargers, were not read in their current text for this page. Check them for the product and date you test.
OCMF, the format
The Open Charge Metering Format grew out of a data format of ABL, discussed with KEBA and has.to.be, and is now maintained by S.A.F.E. e.V. The specification is published under CC BY-ND 4.0. A record is plain text in three parts: the word OCMF, a JSON payload and a JSON signature, separated by a vertical bar.
| Part of the payload | Keys | What it says |
|---|---|---|
| General information | FV, GI, GS, GV | Format version, and the identity, serial number and software version of the signing unit (the "gateway") |
| Pagination | PG | A context letter and a counter: T for readings in transactions (mandatory), F for fiscal readings outside transactions; each counter goes up by exactly 1 |
| Meter identification | MV, MM, MS, MF | Vendor, model, serial number (required) and firmware of the meter |
| User assignment | IS, IT, ID and related keys | Whether and how the user was identified, for example an RFID card or an ISO 15118 contract |
| Readings | RD, an array of TM, TX, RV, RI, RU, RT, CL, EF, ST | Time with its synchronisation state, the reason for the reading (B begin, C charging, X exception, E end, and finer end codes), value, OBIS register, unit, current type, cumulated cable loss, error flags and meter status |
| Cable loss compensation | LC with LN, LI, LR, LU | The cable resistance a DC meter used to correct its reading to the point of transfer (since 1.2.0) |
| Part of the signature | Keys | What it says |
|---|---|---|
| Algorithm | SA | For example ECDSA-secp256r1-SHA256, the default since format 0.4; others use secp192, secp256k1, secp384r1 or brainpool curves |
| Encoding | SE | hex (default) or base64 |
| Type | SM | application/x-der (default) |
| Signature | SD | The signature itself |
The signature covers the payload exactly as it was written. Adding or removing white space, or letting a JSON parser rewrite a number (another exponent, fewer decimals), breaks it. Software that stores or forwards OCMF must keep the string byte for byte.
| Revision | Date | Change |
|---|---|---|
| 1.0.2 | 15 February 2020 | Binary format removed, best practice for OCPP transport added |
| 1.1.0 | 9 February 2023 | Ad hoc charging and tariff information |
| 1.2.0 | 24 May 2023 | Cable loss compensation data |
| 1.3.0 | 18 April 2024 | Optional firmware version of the charge controller (CF) |
| 1.4.0 | 5 December 2024 | Unified OBIS definitions after IEC 62056-6-1 |
| 1.4.1 | 15 January 2025 | Clarification of the OBIS definitions |
How OCMF travels in OCPP
- OCPP 1.5 and 1.6: a sampled value with the format SignedData next to the plain value, in MeterValues and StopTransaction. The OCMF specification suggests clock aligned readings every 900 seconds of Energy.Active.Import.Register, because tariff changes usually happen on the quarter hour, and signed readings at the start and end of each transaction.
- OCPP 2.0.1: a sampled value can carry a signedMeterValue with four required fields: signedMeterData (base64, up to 2500 characters), signingMethod, encodingMethod and publicKey (base64, up to 2500 characters).
- OCPP 2.0.1 configuration: SampledDataSignReadings asks for signed values in TransactionEvent, AlignedDataSignReadings in MeterValues, and PublicKeyWithSignedMeterValue (Never, OncePerTransaction or EveryMeterValue) decides how often the key is sent. When it is not sent, publicKey is an empty string, because the field is required.
The exact strings a charger puts into signingMethod and encodingMethod for an OCMF record are not fixed in the sources read. Check what the charger and the backend expect.
What a verifier checks
The OCMF specification describes the check, and transparency software performs it:
- Restore the signed data: separate header, payload and signature, keep the payload unchanged.
- Verify the signature with the public key, which comes from another path (the charger display, a register), never only from the data itself.
- Tie the key to the source: the serial numbers in the record identify the signing unit, and all records of one session come from the same one.
- Check the chain: pagination without gaps, the first record marked as begin, the last as end, nothing removed or added in between.
- Check the readings: no error flags or error states, a synchronised time where time matters for the price, and the billed energy equal to the end reading minus the start reading.
Testing this path end to end is part of Billing and measurement testing. On the backend side, this analyzer already checks one precondition with PW-06: the meter values the charger sends in OCPP never go backwards within a transaction.
In this tool
The analyzer finds OCMF records in an OCPP log: base64 in the signedMeterValue of OCPP 2.0.1 and 2.1, as SignedData text or hex in OCPP 1.6, or anywhere else a message carries a string that starts with OCMF. The OCPP tab lists each record with its readings and checks its signature in the browser, on every curve of the OCMF signature algorithms (secp192k1, secp256k1, secp192r1, secp256r1, brainpool256r1, secp384r1 and brainpool384r1, each with SHA-256).
- SM-01 checks the signature with the public key the charger sends beside the record. That shows the record is intact, not that the key belongs to the meter; paste the key from the charger or the register into the OCPP tab to check against that one.
- SM-02 checks that the signed readings count up, carry the meter state G and no error flags, and agree with the unsigned register sent in the same meter value.
- SM-03 checks that the records make up a whole transaction: one meter, pagination without gaps, a begin reading first and an end reading once the transaction ended, and a synchronised time.
The analyzer is not transparency software approved under calibration law; a driver who wants to check an invoice uses the software the operator names.
Sources
- S.A.F.E. e.V.: Open Charge Metering Format (OCMF), OCMF-en.md, revision 1.4.1 of 15 January 2025; document licence CC BY-ND 4.0; sections on OCPP embedding, signing and verification, pagination, readings, signature methods
- Open Charge Alliance: OCPP 2.0.1 JSON schemas, MeterValuesRequest and TransactionEventRequest, SignedMeterValueType; as shipped in the Mobility House ocpp library
- EVerest: OCPP 2.0.1 standardized component configuration, OCPPCommCtrlr.PublicKeyWithSignedMeterValue, SampledDataCtrlr.SampledDataSignReadings, AlignedDataCtrlr.AlignedDataSignReadings
- Mess- und Eichgesetz (MessEG)
- Mess- und Eichverordnung (MessEV)
- S.A.F.E. e.V.: Transparenzsoftware
- Chargy desktop app, README: formats supported, PTB certification, licence
- VDE: Eichrechtskonformes Laden