nuts-foundation / nuts-foundation/nuts-node
did:x509 resolver: CRL check and set expires/revoked on keys
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 28
- Forks
- 23
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 76
Description
Parent PRD
#4079
What to build
Extend the did:x509 resolver to perform CRL checking during DID resolution and annotate the resulting DID document's verification methods with expires and revoked metadata.
- Inject
pki.Validatorinto the did:x509 resolver via constructor injection (NewResolver(pkiValidator)) - Update
vdr.goto passpkiValidatorwhen constructing the resolver - In
Resolve(), after chain validation succeeds:- Perform CRL check via
pkiValidator.CheckCRL(chain) - If a certificate is revoked, set
Revokedon the verification method with the revocation date - Set
Expireson the verification method from the leaf certificate'snotAfterdate
- Perform CRL check via
- Remove the CRL check and cert-time validation from
X509CredentialValidator(these are now handled by the resolver) - Remove the ad-hoc resolver instantiation in
X509CredentialValidator(didx509.NewResolver()at validator.go:276)
This makes CRL and cert-time information available for any credential with a did:x509 issuer, regardless of credential type (PatientEnrollmentCredential, HealthcareProfessionalDelegationCredential, HealthcareProviderCredential, etc.).
See PRD #4079 Part A and PSA 10.4.2 / 10.4.3 for full context.
Acceptance criteria
- did:x509 resolver accepts
pki.Validatorvia constructor injection - CRL check is performed during
Resolve()after chain validation -
Revokedfield is set on the verification method when the certificate is on the CRL -
Expiresfield is set on the verification method from the leaf cert'snotAfter - CRL check and cert-time validation are removed from
X509CredentialValidator - Ad-hoc resolver instantiation in
X509CredentialValidatoris removed - Existing X509Credential tests pass
- New test: credential with a revoked did:x509 cert gets
Revokedset on the key - New test: credential with a did:x509 cert gets
Expiresset fromnotAfter
Blocked by
- Blocked by #4082 (
expires/revokedfields on VerificationMethod in go-did)
User stories addressed
- User story 1: PatientEnrollmentCredentials get CRL checks
- User story 4: CRL checks at the key resolution layer for all did:x509 credentials
- User story 5: trust anchor validation at DID resolution layer
- User story 6: key validity information available for time-based checks
- User story 7: existing X509Credential behavior preserved
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the did:x509 resolver's Resolve() and vdr.go construction, then inspect validator.go around line 276 and the existing X509Credential tests. Confirm the resolver receives pki.Validator, CRL/revocation and expiry metadata are covered by new tests, and existing tests pass after validator-side checks are removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100