#!/usr/bin/env python3
# Automotive PKI certificate lifecycle management
pki_hierarchy = {
"OEM Root CA": {
"protection": "Offline HSM; air-gapped network; 4-person ceremony to use",
"validity": "30 years",
"key": "ECDSA P-384",
"issues": "Intermediate CAs only",
},
"Intermediate CA (Vehicle ECU)": {
"protection": "Online HSM (FIPS 140-2 Level 3)",
"validity": "10 years",
"key": "ECDSA P-256",
"issues": "ECU leaf certificates during production",
},
"ECU Leaf Certificate": {
"subject": "CN=TCU_TYPE_VIN_SERIAL, O=OEM_GmbH",
"san": "URI: urn:automotive:ecuid:0xA3 (service binding)",
"validity": "~15 years (vehicle lifetime)",
"key_usage": "digitalSignature (firmware certs); keyEncipherment (TLS certs)",
"provisioned_at": "EOL production via AUTOSAR SecureOnboardCommunication",
}
}
# Certificate renewal on-vehicle
renewal_process = {
"trigger": "notAfter within 12 months; or manual VSOC request",
"protocol": "AUTOSAR CertMgmt module → CSR → OEM PKI backend over TLS",
"authentication": "Current valid cert used to authenticate renewal request",
"delivery": "New cert delivered in UDS WriteDataByIdentifier 0x2E over TLS DoIP",
}
import json
print("PKI Hierarchy:")
for ca, details in pki_hierarchy.items():
print(f" {ca}: {json.dumps(details, indent=4)}")
print("\nRenewal Process:", json.dumps(renewal_process, indent=2))