Plug and Charge and its PKI

The certificate hierarchies behind Plug and Charge, who issues and holds each certificate, and how ISO 15118-2 and ISO 15118-20 use them on the wire.

Four hierarchies, one leaf each

Plug and Charge replaces the RFID card with certificates. The charger proves who it is in the TLS handshake with its SECC certificate; the car proves which contract pays by signing messages with the private key of its contract certificate; and the contract itself reaches the car through a certificate installation that the car maker's provisioning certificate protects. Each of these comes from its own public key infrastructure, and each chain has at most a root, two sub-CAs and a leaf.

CertificateIssued byHeld byUsed for
V2G root CAItself (self-signed), run by a V2G root operatorCar and charger, as a trust anchor; never sent on the wireAnchor of the charger (CPO) and provisioning service (CPS) chains; in ISO 15118-2 it may also anchor contract chains
CPO Sub-CA 1V2G root CAThe PKI operator or the charge point operatorSigns CPO Sub-CA 2
CPO Sub-CA 2CPO Sub-CA 1The charge point operatorSigns SECC certificates
SECC certificate (leaf)CPO Sub-CA 2The charger, with its private keyTLS server authentication
MO or eMSP root CAItself, run by or for the mobility operatorChargers and backends, as a trust anchorAnchor of contract certificate chains
MO Sub-CA 1 and 2MO root (or a V2G root), then Sub-CA 1The mobility operatorSign contract certificates
Contract certificate (leaf)MO Sub-CA 2The car, with its private keyCarries the eMAID in its subject; signs AuthorizationReq and MeteringReceiptReq
OEM root CAItself, run by the car makerCar maker and the provisioning backendsAnchor of OEM chains
OEM Sub-CA 1 and 2OEM root, then Sub-CA 1The car makerSign provisioning certificates (and vehicle certificates in ISO 15118-20)
OEM provisioning certificate (leaf)OEM Sub-CA 2The car, installed at productionIdentifies the car by its PCID; signs CertificateInstallationReq; its key protects the contract key during installation
Vehicle certificate (ISO 15118-20)OEM sub-CAThe carTLS client authentication in mutual TLS
CPS Sub-CA 1 and 2V2G root, then Sub-CA 1The PKI operatorSign the CPS leaf
CPS leafCPS Sub-CA 2The certificate provisioning serviceSigns the installation data in CertificateInstallationRes so the car can verify it against a V2G root

The issuer of the ISO 15118-20 vehicle certificate is given here as an OEM sub-CA, which is how deployed OEM PKIs work; the exact chain the standard prescribes is to be checked against ISO 15118-20.

The message schemas leave room for these depths: a certificate chain element carries a leaf plus up to 4 sub-certificates in ISO 15118-2 and up to 3 in ISO 15118-20, and ListOfRootCertificateIDs names up to 5 roots in ISO 15118-2 and up to 20 in ISO 15118-20 (as the libcbv2g codec generated from the schemas has them).

Trust anchors, several roots and cross-certification

  • The car holds one or more V2G roots (to check the charger chain and the CPS signature), its OEM provisioning certificate and key, and after installation one or more contract chains with their keys. In ISO 15118-20 it also holds a vehicle certificate chain.
  • The charger holds its SECC chain and key, possibly one chain per V2G root it is enrolled under, the V2G roots, and the MO roots it needs to check contract chains locally. Many chargers forward the contract chain to their backend instead and wait with EVSEProcessing Ongoing.
  • The backend holds MO and OEM roots and talks to the OCSP responders and the provisioning service.

More than one V2G root exists in the market, and a car that trusts only root A cannot validate a charger chain under root B. Three mechanisms deal with this. The car tells the other side which roots it holds: ListOfRootCertificateIDs in the certificate messages, and in ISO 15118-20 the certificate_authorities extension of the ClientHello, so the charger can pick a matching chain. A root operator can cross-certify another root (issue a certificate for its key), so one chain validates to either anchor. And industry trust lists collect the approved roots that car makers and operators install.

Whether and how a car tells a TLS 1.2 charger which V2G roots it holds (for example the trusted_ca_keys extension of RFC 6066) is to be checked against ISO 15118-2.

ISO 15118-2 compared with ISO 15118-20

AspectISO 15118-2ISO 15118-20
TLS versionTLS 1.2TLS 1.3 (clause 7.7.3)
Cipher suitesTLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 and TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256TLS_AES_256_GCM_SHA384 and TLS_CHACHA20_POLY1305_SHA256
Keys and signaturessecp256r1, ECDSA with SHA-256secp521r1 with ECDSA and SHA-512, or Ed448 (x448 for key exchange)
Client authenticationNone in TLS; the car proves its contract by signing at the application layerMutual TLS: the charger asks for the vehicle certificate
Revocation in the handshakeNot part of the handshake profileOCSP stapling requested with status_request
Largest certificate800 bytes in the message schema1600 bytes (V2G20-1234)
Contract chain sent inPaymentDetailsReqAuthorizationReq (PnC_AReqAuthorizationMode)
Challenge sent inPaymentDetailsResAuthorizationSetupRes (PnC_ASResAuthorizationMode)
Certificate messagesCertificateInstallation and CertificateUpdateCertificateInstallation only; it also renews, and can deliver several contracts

ISO 15118-20 also defines a pairing mode for private chargers, where the car accepts a charger certificate outside the public V2G roots; the car then sends an empty certificate_authorities list. See the ISO 15118-20 security page for the handshake details.

When the ISO 15118-20 car must answer the certificate request (always, or only for Plug and Charge) is to be checked against clause 7.7.3.

Plug and Charge authorisation in ISO 15118-2

  1. EV: ServiceDiscoveryReq
  2. EVSE: ServiceDiscoveryRes, PaymentOptionList contains Contract; the Certificate service may be offered too
  3. EV: PaymentServiceSelectionReq, SelectedPaymentOption Contract
  4. EV: PaymentDetailsReq, eMAID and ContractSignatureCertChain
  5. EVSE: PaymentDetailsRes, a fresh 16 byte GenChallenge and EVSETimeStamp
  6. EV: AuthorizationReq, echoes GenChallenge; the header carries a signature made with the contract key
  7. EVSE: AuthorizationRes, EVSEProcessing Ongoing while the backend checks, then Finished
  8. EVSE: ChargingStatusRes or CurrentDemandRes, ReceiptRequired true with MeterInfo
  9. EV: MeteringReceiptReq, SessionID, SAScheduleTupleID and MeterInfo, signed with the contract key
  10. EVSE: MeteringReceiptRes

The charger (or its backend) validates the contract chain up to an MO or V2G root, checks its revocation status, verifies the signature over AuthorizationReq with the public key of the contract certificate and compares the challenge with the one it sent. Each failure has its own response code: FAILED_CertChainError, FAILED_CertificateRevoked, FAILED_CertificateExpired, FAILED_SignatureError, FAILED_ChallengeInvalid, FAILED_ContractCanceled. The code dictionary (response-code) explains each. SQ-07 checks that Contract was offered before the car chose it, and SQ-10 that a requested metering receipt arrives.

In ISO 15118-20 the steps move: AuthorizationSetupRes announces the authorisation services and carries the GenChallenge, AuthorizationReq carries the contract chain and the signed challenge, and the signed meter reading goes in MeteringConfirmationReq.

Contract certificate installation

  1. EVSE: ServiceDiscoveryRes or AuthorizationSetupRes, ISO 15118-2: the Certificate service; ISO 15118-20: CertificateInstallationService true
  2. EV: CertificateInstallationReq, ISO 15118-2: OEMProvisioningCert and ListOfRootCertificateIDs. ISO 15118-20: OEMProvisioningCertificateChain, ListOfRootCertificateIDs, MaximumContractCertificateChains, optional PrioritizedEMAIDs. Signed with the provisioning key
  3. EVSE: CertificateInstallationRes, the charger relays the request to its backend and the provisioning service; the answer carries the CPS chain, the contract chain, an ephemeral public key and the encrypted contract private key
  4. EV: PaymentDetailsReq or AuthorizationReq, the session goes on with the new contract

The car checks the CPS signature against one of its V2G roots, runs an ECDH key agreement between its provisioning private key and the ephemeral public key (DHpublickey in ISO 15118-2, DHPublicKey with ECDHCurve SECP521 or X448 in ISO 15118-20), derives a symmetric key and decrypts the contract private key. ISO 15118-20 also allows the key to be delivered for a TPM (TPM_EncryptedPrivateKey), and reports in RemainingContractCertificateChains how many more contracts wait for the car.

ISO 15118-2 renews a contract with CertificateUpdateReq, which carries the current contract chain, the eMAID and ListOfRootCertificateIDs and is signed with the current contract key; the response has the same shape as the installation response. ISO 15118-20 has no update message and runs another installation instead.

ISO 15118-2 gives the certificate messages a longer response time than most requests; the tool uses 5 s (tim.msgTimeoutLongS), which is still flagged for verification in the limit profile. All of this runs inside TLS, so a capture shows it only when decrypted.

What this tool checks

  • PK-01 compares the validity window of the charger's leaf certificate with the time of the handshake taken from the capture. It is not applicable when the capture has only relative timestamps or the certificate is encrypted (TLS 1.3 without a key log).
  • PK-02 looks at every certificate of the charger chain: validity dates in UTCTime before 2050 and GeneralizedTime from 2050 (RFC 5280 4.1.2.5), no unknown or wrongly critical extensions (RFC 5280 4.2), the size limit of the profile (pki.maxCertificateBytes for TLS 1.2, pki.maxCertificateBytesIso20 for TLS 1.3), and no root inside the chain (V2G20-2399).
  • TL-07 checks that a TLS 1.2 charger does not ask for a client certificate, since ISO 15118-2 authenticates the car at the application layer.

Contract certificates in PaymentDetailsReq, AuthorizationReq and the certificate messages appear as fields in the message detail, and the response codes that refuse them are reported by SQ-05.

Sources

  • ISO 15118-2:2014, security concept, certificate profiles and the PaymentDetails, Authorization, CertificateInstallation, CertificateUpdate and MeteringReceipt messages
  • ISO 15118-20:2022, clause 7.7.3 (TLS), certificate handling, AuthorizationSetup, Authorization and CertificateInstallation messages, V2G20-1234
  • RFC 5280, X.509 certificate and path validation profile
  • RFC 8446, TLS 1.3, clause 4.4.2.1 (OCSP status per certificate entry)
  • RFC 6960, OCSP
  • VDE-AR-E 2802-100-1, German application rule on certificate handling between vehicles, chargers and backends