Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use the proper cbor tag code for Dates #24

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Conversation

siacomuzzi
Copy link
Contributor

@siacomuzzi siacomuzzi commented Oct 17, 2024

The following attributes must be tag 1004 (full-date). A full-date data item shall contain a full-date string as specified in RFC 3339:

issuerSigned -> nameSpaces -> org.iso.18013.5.1.mDL -> birth_date
issuerSigned -> nameSpaces -> org.iso.18013.5.1.mDL -> issue_date
issuerSigned -> nameSpaces -> org.iso.18013.5.1.mDL -> expiry_date
issuerSigned -> nameSpaces -> org.iso.18013.5.1.mDL -> driving_privileges[].issue_date
issuerSigned -> nameSpaces -> org.iso.18013.5.1.mDL -> driving_privileges[].expiry_date
24(<<{
  "digestID": 2,
  "elementIdentifier": "birth_date",
  "elementValue": 1004("2007-03-25"),
  "random": h'a0657b6ccd3228a7da0849ec5193ed5bf83561a4ccea35ee87a4bdb4a588d15e',
}>>),
24(<<{
  "digestID": 5,
  "elementIdentifier": "issue_date",
  "elementValue": 1004("2023-09-01"),
  "random": h'6b2d1eeb2442c97c34f612e384afa186a59a5d19d4cf21ecc8a2ef0b2b7681aa',
}>>),
24(<<{
  "digestID": 6,
  "elementIdentifier": "expiry_date",
  "elementValue": 1004("2028-09-30"),
  "random": h'3b9e53f00edc1f40087f4cf2fdc7615cac9855de7af9ea4b3eefb9cf12eb797a',
}>>),
24(<<{
  "digestID": 11,
  "elementIdentifier": "driving_privileges",
  "elementValue": [
      {
          "vehicle_category_code": "A",
          "issue_date": 1004("2021-09-02"),
          "expiry_date": 1004("2026-09-20"),
      },
      {
          "vehicle_category_code": "B",
          "issue_date": 1004("2022-09-02"),
          "expiry_date": 1004("2027-09-20"),
      },
  ],
  "random": h'81848c60ca94314ec6e5d7defd40455c67cd48f277ebec796d6d1a4c57a0ded9',
}>>),

The following attributes must be tag 0 (tdate). A tdate data item shall contain a date-time string as specified in RFC 3339:

issuerSigned -> issuerAuth -> validityInfo -> signed
issuerSigned -> issuerAuth -> validityInfo -> validFrom
issuerSigned -> issuerAuth -> validityInfo -> validUntil
issuerSigned -> issuerAuth -> validityInfo -> expectedUpdate
"validityInfo": {
  "signed": 0("2023-10-24T14:55:18Z"),
  "validFrom": 0("2023-10-24T15:00:18Z"),
  "validUntil": 0("2053-10-24T14:55:18Z"),
}

closes #21

@siacomuzzi siacomuzzi changed the title feat: use a proper cbor tag code for Dates feat: use the proper cbor tag code for Dates Oct 17, 2024
@jfromaniello jfromaniello merged commit 87a39cb into main Oct 18, 2024
3 checks passed
@siacomuzzi siacomuzzi deleted the fix_dates branch October 18, 2024 15:31
Copy link

🎉 This PR is included in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validity timestamp truncation
2 participants