@adcp/sdk API Reference - v17.0.0-rc.0
    Preparing search index...

    Function resolvePublisherSigningKeyPin

    • The publisher's signing_keys pin for a message from agentUrl, read from the publisher's adagents.json (adcontextprotocol/adcp#9016). Use it as PublisherSigningKeyPin.signingKeys.

      Only entries that BOTH match agentUrl (with agentUrlMatchesAuthorizedEntry, so origin-only entries count at 3.3+) AND authorize the message's scope count. Such an entry:

      • resolves to something, so an unresolvable or signals-only entry does not count;
      • is inside its effective window at at;
      • covers country, and each property in propertyIds.

      An entry that authorizes nothing for the message never pins or unpins it, so callers MUST pass the message's scope.

      Among the entries that count:

      • The publisher pins the agent only if every one carries signing_keys. If any has none (absent or empty), the result is undefined: no pin, so use the agent's JWKS alone.
      • Otherwise the result is the union of their keys. Identical keys appear once. Copies that differ in revoked_at are all kept, so the earliest revocation applies whatever the entry order.
      • With propertyIds, each property gets its own pin, and the result keeps only the keys every pinned property allows.

      Returns [], which PublisherSigningKeyPin reads as "accept no key", when the agent is NOT authorized for the message:

      • it is not listed;
      • below 3.3 it matches more than one exact entry (ambiguous_agent_url);
      • no entry authorizes the scope;
      • no entry authorizes one of propertyIds;
      • the pinned properties share no key.

      Not being authorized is never reported as "no pin".

      const pinFor = (adagents: AdAgentsJson) =>
      resolvePublisherSigningKeyPin(adagents, sellerAgentUrl, { adcpVersion, country, propertyIds });
      const pin: PublisherSigningKeyPin = {
      publisher: 'publisher.example',
      signingKeys: pinFor(adagents),
      // Your own uncached adagents.json fetch; null means the publisher no longer pins.
      refresh: async () => pinFor(await fetchAdagentsUncached()) ?? null,
      };

      Parameters

      Returns Record<string, unknown>[] | undefined