Skip to main content

Module canonical

Module canonical 

Source
Expand description

Canonical key pair of an ITS-S (ETSI TS 102 941 V2.2.1 clause 6.1.2).

The ITS-S signs its initial enrolment request with the canonical private key (signer self, clause 6.2.3.2.1); the EA verifies it with the canonical public key registered for the canonical identifier (itsId) before the first request. An unregistered identifier is refused with unknownits, a request signed with another key with invalidsignature.

load_or_create_canonical_key keeps the key pair in two files:

  • <path>: the private key, PKCS#8 PEM, mode 0600, created once (never overwritten);
  • <path minus .pem>.pub.pem: the public key, SubjectPublicKeyInfo PEM, to be registered with the EA (pythonpki: ea-tool register --its-id ... --public-key ...).

The canonical identifier may be assigned (manufacturer) or generated by the ITS-S (clause 6.1.3); canonical_id generates a stable one from the public key: the last 8 octets of SHA-256 over the DER SubjectPublicKeyInfo.

The formats and the identifier are the same in FlexStack (flexstack.security.pki_client.canonical).

Structs§

CanonicalKey
The canonical key pair kept on disk.

Functions§

canonical_id
Canonical identifier generated from a public key PEM: the last 8 octets of SHA-256 over its DER SubjectPublicKeyInfo.
load_or_create_canonical_key
The canonical key pair kept at path, created (NIST P-256) when absent.
public_key_path
canonical_key.pem -> canonical_key.pub.pem.
public_pem
SubjectPublicKeyInfo PEM of a canonical private key PEM (P-256).