Expand description
ITS-S side of the ETSI TS 102 941 V2.2.1 security management messages:
enrolment (clause 6.2.3.2) and authorization (clause 6.2.3.3), with the
official ASN.1 modules (crate::security::pki_asn).
The functions build the request messages and read the responses; they do
no I/O. Times are UTC seconds (now) so that callers can inject a clock.
Enrolment request (clause 6.2.3.2.1, Figure 14):
EtsiTs103097Data-Encrypted (certRecipInfo of the EA, ECIES) of an
EtsiTs103097Data-Signed (signer self with the canonical key, or digest of
the EC) of EtsiTs102941Data {v1, enrolmentRequest} whose content is the
InnerEcRequestSignedForPop (signer self, new key) of the InnerEcRequest.
Authorization request (clause 6.2.3.3.1, Figures 17 and 18): encrypted to
the AA, the EtsiTs102941Data {v1, authorizationRequest} either signed
with the new AT key (proof of possession) or unsecured; the InnerAtRequest
carries encryptedEcSignature (encrypted to the EA): the
EtsiTs103097Data-SignedExternalPayload by the EC over the SHA-256 hash of
the SharedAtRequest.
Responses (clauses 6.2.3.2.2 and 6.2.3.3.2): encrypted with the request’s AES key (pskRecipInfo), signed by the EA / AA (signer digest), with the leftmost 16 octets of SHA-256 of the request as requestHash.
Structs§
- Pending
Request - A request sent: its encoding, AES key and the new key pair to certify.
- PkiProtocol
Error - A response cannot be read or does not match the request (
codenames the check).
Constants§
- CT_
REQUEST - HTTP content types (Annex C).
- CT_
RESPONSE - PSID_
CERT_ REQUEST - ITS-AID “secured certificate request” (ETSI TS 102 965).
- SSP_
AUTHORIZATION_ REQUEST - SSP_
ENROLMENT_ REQUEST - SSP_
VERSION - Certificate request SSP (clause B.4): version 1, then the permission bits.
Functions§
- build_
authorization_ request - AuthorizationRequestMessage (
popfalse) or AuthorizationRequestMessageWithPop (clause 6.2.3.3.1), with privacy (encryptedEcSignature to the EA). A new key pair and hmacKey are generated. - build_
enrolment_ request - EnrolmentRequestMessage (clause 6.2.3.2.1). Initial request (
current_ecNone): itsId = canonical identifierits_id, outer signer self with the canonical keysigner_key. Re-keying: itsId = HashedId8(EC), outer signer digest(EC) with the EC key. A new verification key pair is generated. - certificate_
ssp - The SSP an EC requests: version 1, enrolment and authorization requests.
- certifies
- The verification key certified by
certificateequalskey(both canonical). - data_
payload - SignedDataPayload
data= unsecured EtsiTs103097Data containingcontent. - decrypt_
psk - Decrypt a response encrypted with the request’s AES key (exactly one
pskRecipInfo with
psk_id); returns the decoded inner Ieee1609Dot2Data. - encrypt_
to - EtsiTs103097Data-Encrypted for the encryption key of
certificate: one certRecipInfo (its HashedId8), ECIES (fresh ephemeral key, KDF2 with P1 = SHA-256 of the canonical certificate, MAC1) on the AES-128-CCM key, which encryptsplaintextwith a fresh nonce. Returns the data and the AES key. - key_tag
- keyTag: HMAC-SHA256 with
hmac_keyover the serialization of the verificationKey and of the encryptionKey (if present), leftmost 128 bits. - psk_id
- HashedId8 of the COER SymmetricEncryptionKey {aes128Ccm} holding
key(pskRecipInfo, IEEE 1609.2 clause 6.3.34). - read_
authorization_ response - InnerAtResponse of an AuthorizationResponseMessage (clause 6.2.3.3.2).
- read_
enrolment_ response - InnerEcResponse of an EnrolmentResponseMessage (clause 6.2.3.2.2).
- read_
signed - Content of an EtsiTs103097Data-Signed by
signer(signer digest, psid 623, generationTime present, no other header, valid signature); errors otherwise. - request_
hash - Leftmost 16 octets of SHA-256 of the request’s EtsiTs103097Data-Encrypted.
- sign
- An EtsiTs103097Data-Signed with headerInfo {psid 623, generationTime} only.
The signer is
selfwhensigneris None (signature input with the empty signer, IEEE 1609.2 clause 5.3.1), else the digest ofsigner. - ssp_
permits - The certificate’s appPermissions grant ITS-AID 623 with SSP version 1 and
bit(clause B.4: 0x80 enrolment request, 0x40 authorization request). - time32
- Time32 (TAI seconds since the ITS epoch, IEEE 1609.2 clause 6.4.15).
- time64
- Time64 (TAI microseconds since the ITS epoch), as generationTime.