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

Make VC Verify more robust #291

Merged
merged 12 commits into from
Apr 2, 2024
Merged

Make VC Verify more robust #291

merged 12 commits into from
Apr 2, 2024

Conversation

nitro-neal
Copy link
Contributor

@nitro-neal nitro-neal commented Apr 1, 2024

Overview

Added vcJwt checks to verify

Description

 * If any of these steps fail, the function will throw a [IllegalArgumentException] with a message indicating the nature of the failure:
 * - exp MUST represent the expirationDate property, encoded as a UNIX timestamp (NumericDate).
 * - iss MUST represent the issuer property of a verifiable credential or the holder property of a verifiable presentation.
 * - nbf MUST represent issuanceDate, encoded as a UNIX timestamp (NumericDate).
 * - jti MUST represent the id property of the verifiable credential or verifiable presentation.
 * - sub MUST represent the id property contained in the credentialSubject.

How Has This Been Tested?

Added new vector - TBD54566975/web5-spec#146

@jiyoonie9
Copy link
Contributor

@nitro-neal can you link the spec text where we talk about the date fields like exp iat nbf being numeric values? @kirahsapong and i were wondering about whether it should be a date or a long field while working in web5-swift.

@nitro-neal
Copy link
Contributor Author

here is vcdata model - https://www.w3.org/TR/vc-data-model/#jwt-encoding

@jiyoonie9 jiyoonie9 merged commit c1c8f3e into main Apr 2, 2024
7 checks passed
@jiyoonie9 jiyoonie9 deleted the more-robust-verify branch April 2, 2024 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants