Skip to content
Wallet and Entity Collection draft updates
Documentation menu

6.5. Publish a received Trust Mark in an EC

Feature guides / 6. Trust Marks · Example context

The Verifier Auditor sends Car Rental Company its JWT through an agreed channel. An operator can paste it into a dashboard; the host checks it before publishing the reference in Car Rental Company's EC. trust_marks; Subject binding.

Attach a received mark

import { Leaf } from "@oidfed/leaf";
import type { CryptoContext, TrustMarkIssuerContext } from "@oidfed/core";

export async function publishCarRental(
  crypto: CryptoContext, jwt: string, issuerEvidence: TrustMarkIssuerContext,
) {
  const shop = await Leaf.create({
    entityId: "https://car-rental.example", authorityHints: ["https://licence-federation.example"],
    crypto, metadata: { federation_entity: { organization_name: "Car Rental Company" } },
  });
  await shop.attachTrustMark(jwt, {
    issuerEvidence, expectedTrustMarkType: "https://licence-federation.example/marks/approved-verifier",
  });
  return shop;
}

Leaf, Intermediate, and TrustAnchor expose these holder methods. Attachment verifies issuer trust, the holder's Entity Identifier, type, dates, and any required delegation. Exact JWT duplicates are idempotent. By default a second valid mark is appended. Choose replacement: "same-issuer-and-type" to replace that pair's prior references.

The host stages and signs the new EC before changing publication state. A failed signer preserves the prior references and cache. Returned references are detached copies.

import type { Leaf } from "@oidfed/leaf";

export function removeExpiredPublication(shop: Leaf, expiredJwt: string) {
  return shop.removeTrustMark({ jwt: expiredJwt });
}

Removal works without validating an already expired token. It removes publication only; contact the issuer or use its authorized administrative service to revoke the accreditation record. Federation standardizes the EC's trust_marks references, while delivery and dashboard workflows belong to the host.

If the new JWT is already attached, replacement: "same-issuer-and-type" still removes the older marks from that issuer for that type. Other accreditations stay in the EC. If publication fails, the previous references remain intact.

Publish evidence the holder has accepted

Car Rental Company can receive a JWT by retrieval, a file, or a paste into its authenticated dashboard. Delivery does not establish issuer trust. Run the holder's attachment workflow with the expected type, subject, and issuer evidence before publishing it in an Entity Configuration.

After attaching or removing a mark, obtain the next Entity Configuration and inspect its trust_marks references. Consumers may still hold an earlier signed configuration until it expires. Removing a local reference stops future publication; revoking accreditation is the issuer's operation and has a different effect.

Next: 6.6. Check the status of an exact Trust Mark JWT

View source on GitHub