16.11. Verify a credential using trusted issuer context
Feature guides / 16. Wallet workflows · Example context
Car Rental Company receives a driving licence presentation. Establishing Licensing Authority's federation identity supplies trusted issuer context, but Car Rental Company must still verify the credential and the presentation that carries it.
How to use it
CredentialVerifierRole.verifyCredential() validates issuer trust and invokes the required format callback with the credential, issuer evidence, and available protocol keys. The callback contract is deliberately explicit: the application performs format-specific verification. Wallet verification; VP response verification.
import type { CryptoEngine } from "@oidfed/crypto";
import { CredentialVerifierRole, type CredentialVerificationOptions } from "@oidfed/wallet";
import type { TrustAnchorSet } from "@oidfed/core";
export async function verifyDrivingLicence(
engine: CryptoEngine,
credential: unknown, anchors: TrustAnchorSet,
verifyCredential: CredentialVerificationOptions["verifyCredential"],
) {
return CredentialVerifierRole.verifyCredential(credential, "https://licensing-authority.example", anchors, {
engine,
verifyCredential,
});
}
What your application owns
Verify integrity, issuer authenticity, credential dates, holder binding, query satisfaction, and any status required by the credential profile or business policy. The wrapper's trusted issuer result does not replace these checks. Pass only after the callback has done them. The host also decides whether an active driving licence entitles Maya to the requested rental; the application owns that eligibility decision.
Pass trusted issuer context to the format verifier
A federation assessment gives the host trusted issuer metadata and policy. The credential-format verifier uses that context to check the credential's own proof, structure, and relevant format rules. Neither check replaces the other.
Return false from verifyCredential when the format is unsupported or verification fails; only true accepts. The callback may return a promise of that boolean. A recognized issuer does not make every object naming that issuer valid. Licensing Authority driving licence status and the relying shop's business rules may require additional host checks after cryptographic and federation verification.
Next: 16.12. Verify an alternative Wallet Attestation format