Preserve time zone offsets in credentials #233
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Verifiable Credentials use a RFC 3339 date-time in the issuanceDate and expirationDate properties. In most examples, these are UTC, using "Z" as the
time-offset
part which is allowed as an alternative to the numeric hour-date offset. However, some example VCs in the VC HTTP API test suite use "+00:00" instead of "Z". These were failing verification in ssi/didkit, because the types in ssi's Credential struct were not keeping the information about using "Z" or "+00:00", so whenssi
computed the RDF-based linked data verification hash, the datetimes were serialized differently than when they had been issued.This PR changes the Credential struct to preserve the "use Z" bit in the issuanceDate and expirationDate properties. Additionally, the time zone offset is allowed to be non-UTC - although we don't have examples depending on that, the VC Data Model doesn't seem to require UTC, so we might want to allow it.