In the core, credentials can’t have a validity period.
You can, for example, have a template field called expirationDate (as in our vaccine demo sample) and the verifier can put as a requisite that expirationDate is before the desired date. That would be a way of having validity.