6.10. Verify older Trust Mark signatures after rotation
Feature guides / 6. Trust Marks · Example context
The auditor signed Car Rental Company's mark with K1. Its current EC publishes K2, but the mark has not expired. The verifier needs authenticated historical evidence about K1.
Verify a missing current key
Pass the historical-key policy through the role's trustMarkVerification option. The Wallet role validates Car Rental Company, establishes issuer trust under the accreditation anchors, and evaluates its published marks using the same operation. Hosts and OIDC roles accept the shared option too. The explicit requirements check prevents an invalid or unevaluated mark from being mistaken for accepted accreditation. Historical keys; Current mark validity.
import type { CryptoEngine } from "@oidfed/crypto";
import { CredentialVerifierRole } from "@oidfed/wallet";
import { checkTrustMarkRequirements, type TrustAnchorSet } from "@oidfed/core";
export async function verifyOlderVerifierMark(
engine: CryptoEngine,
drivingLicenceAnchors: TrustAnchorSet, accreditationAnchors: TrustAnchorSet,
) {
const result = await CredentialVerifierRole.discover("https://car-rental.example", drivingLicenceAnchors, {
engine,
trustMarkVerification: {
mode: "resolve", trustAnchors: accreditationAnchors,
historicalKeys: { mode: "on-missing-kid", maxAgeSeconds: 300 },
},
});
if (!result.ok) return result;
const required = checkTrustMarkRequirements(result.value.trustChain, {
requiredTypes: ["https://licence-federation.example/marks/approved-verifier"],
});
return required.ok ? result : required;
}
The issuer evidence comes from current trust processing. History must verify with current issuer keys, match the issuer, and satisfy the selected age limit. The key must have been eligible at the mark's issuance time. Ambiguous keys fail. A signature failure using an available current key never triggers historical fallback.
Revoked keys are rejected by default. An application may explicitly allow named non-security reasons for signatures made before revocation; compromised keys always fail. Additional federation-defined security reasons can be configured. Owner delegation keys remain governed by owner policy, independently of issuer history.
For offline verification use mode: "supplied-only" and responses: [historyJwt]. The resulting evidence deadline includes history freshness, issuer proof, mark expiry, and delegation expiry. History does not prove current accreditation status or extend any of those lifetimes.
When Car Rental Company publishes several marks signed with the same retired key, one chain-validation operation shares the issuer's historical-response request. Each mark is still checked separately. A later operation obtains fresh evidence rather than reusing an indefinitely cached response.
Keep history subordinate to trust
An older mark may refer to a key no longer in the auditor's current configuration. Establish current trust in the issuer before using its authenticated historical-key source, and apply the key's historical validity and revocation information to the mark's issuance time.
The mere presence of a matching kid in downloaded history is insufficient. Offline consumers must carry the required verified history themselves. If it is absent or outside the accepted lifetime, stop verification or request connectivity; do not select another key solely because it uses the same algorithm.
Historical evidence and mark profiles
For a standalone JWT outside a host or role workflow, core's validateTrustMarkWithIssuer() accepts historicalKeys: { mode: "on-missing-kid", maxAgeSeconds }. It consults the trusted issuer's Historical Keys endpoint only when the current keys lack the JWT's kid. A failed signature using a current key never triggers fallback. For offline verification, use mode: "supplied-only" with responses: [historyJwt].
History must be signed with currently trusted issuer keys and meet the selected age limit. Selection checks key issuance/activation and expiry at the mark's iat, rejects ambiguous keys, and rejects revoked keys by default. allowedRevocationReasons permits an explicitly named non-security reason only for signatures made before revocation. Compromise reasons, including configured securityRevocationReasons, always reject. Historical evidence cannot extend the lifetime of a mark, delegation, or issuer proof. It does not establish current active status. Within one chain-validation operation, marks using the same issuer endpoint and request credentials share the historical-response fetch. Each mark still receives its own signature, freshness, lifetime, and revocation checks. Separate operations fetch independently.
trustMarkProfiles registers { typ, trustMarkTypes, validateClaims? } entries for explicitly recognized frameworks. Claims callbacks receive frozen authenticated claims and may return a Result synchronously or asynchronously. Unknown typ values fail; delegation typ remains fixed. Endpoint media types remain those defined by Federation.