<?xml version="1.0" encoding="utf-8"?>
<!-- UTF-8 Check: äöü -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" docName="draft-doehle-company-certs-discovery-00" category="std" consensus="true" ipr="trust200902" obsoletes="" updates="" xml:lang="en" symRefs="true" sortRefs="true" tocInclude="true" version="3">
  <front>
    <title abbrev="Company-Certs Discovery">A Well-Known URI for Discovery of Application-Specific Trust Anchors</title>
    <seriesInfo name="Internet-Draft" value="draft-doehle-company-certs-discovery-00"/>
    <author initials="M." surname="Doehle" fullname="M. Doehle">
      <organization>MPI-Bremen / IT-Dept</organization>
      <address>
        <postal>
          <street>Celsiusstr. 1</street>
          <city>Bremen</city>
          <code>28359</code>
          <country>Germany</country>
        </postal>
	<email>mdoehle@mpi-bremen.de</email>
      </address>
    </author>
    <date year="2026" month="July" day="22"/>
    <abstract>
      <t>
   This document defines the "company-certs" well-known URI in
   accordance with Request for Comments (RFC) 8615. The URI provides a
   JSON metadata document that allows an organization to publish
   application-specific trust anchors and related revocation information
   for use by consuming applications. The mechanism is intended for
   scoped trust bootstrapping, such as S/MIME, mutual TLS, or other
   application-local trust decisions, without modifying the global
   operating system trust store.</t>
      <t>
   Authority to publish such metadata is derived from successful
   validation of the HTTPS endpoint for the associated DNS domain. This
   specification does not provide an independent assessment of the
   trustworthiness of the published trust anchors beyond that domain
   control.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="sect-1" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
   Organizations frequently operate private or application-specific
   Certification Authorities (CAs) for specialized purposes, including
   enterprise S/MIME, mutual TLS for APIs, device authentication, or
   internal service authentication. Distributing the corresponding
   trust anchors to external partners or isolated applications is often
   operationally complex.</t>
      <t>
   This document specifies a discovery mechanism that allows an
   organization to publish trust anchor metadata at a well-known HTTPS
   endpoint. The mechanism is intended to support application-scoped
   trust decisions and does not require installation of the discovered
   trust anchors into a system-wide trust store.</t>
      <t>
   This specification defines:</t>
      <ul spacing="normal">
        <li>a well-known URI suffix, "company-certs";</li>
        <li>a JSON metadata format;</li>
        <li>retrieval and validation rules for consuming clients; and</li>
        <li>security and privacy considerations for such trust bootstrapping.</li>
      </ul>
      <t>This specification does not define:</t>
      <ul spacing="normal">
        <li>
          <t>a mechanism for proving that a published private CA is globally
      trustworthy;</t>
        </li>
        <li>
          <t>a replacement for the Web PKI;</t>
        </li>
        <li>
          <t>a mechanism for modifying a client's operating system trust store;
      or</t>
        </li>
        <li>
          <t>a general-purpose certificate enrollment protocol.</t>
        </li>
      </ul>
    </section>
    <section anchor="sect-2" numbered="true" toc="default">
      <name>Conventions and Terminology</name>
      <t>
   The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>",
   "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and
   "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as described in
   BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all
   capitals, as shown here.</t>
      <t>
   The term "metadata document" refers to the JSON object retrieved from
   the "company-certs" well-known URI.</t>
      <t>
   The term "trust anchor" refers to a CA certificate or certification
   path material published for use by a consuming application under
   local policy.</t>
      <t>
   The term "usage context" refers to the intended application context
   for which a published trust anchor is applicable, such as
   "email_protection" or "client_authentication".</t>
    </section>
    <section anchor="sect-3" numbered="true" toc="default">
      <name>Protocol Overview</name>
      <t>
   An organization publishes a metadata document at its "company-certs"
   well-known URI. The metadata document identifies one or more trust
   anchors, the usage contexts in which they are intended to be used,
   optional constraints on their scope, and optional revocation
   endpoints.</t>
      <t>
   A consuming client retrieves the metadata document over HTTPS,
   validates the HTTPS connection according to local policy and this
   specification, processes the metadata, and may then retrieve the
   referenced certificate chain resources.</t>
      <t>
   Control over the DNS domain hosting the metadata document constitutes
   authority to publish trust anchor metadata for that domain under this
   specification. This authority is based on validated control of the
   HTTPS endpoint and does not constitute an independent attestation of
   the quality, security, or operational trustworthiness of the
   published CA infrastructure.</t>
    </section>
    <section anchor="sect-4" numbered="true" toc="default">
      <name>Well-Known URI</name>
      <t>
   The well-known URI suffix defined by this specification is
   "company-certs", in accordance with <xref target="RFC8615"/>.</t>
      <t>
   For an origin whose authority is "example.org", the metadata document
   URI is:</t>
      <dl newline="false" spacing="normal" indent="3">
        <dt/>
        <dd>
          <eref target="https://example.org/.well-known/company-certs"/>
        </dd>
      </dl>
      <t>
   The metadata document <bcp14>MUST</bcp14> be retrieved via HTTPS. Retrieval over
   HTTP <bcp14>MUST NOT</bcp14> be used.</t>
    </section>
    <section anchor="sect-5" numbered="true" toc="default">
      <name>Metadata Document</name>
      <section anchor="sect-5.1" numbered="true" toc="default">
        <name>General Requirements</name>
        <t>
   The metadata document <bcp14>MUST</bcp14> be a JSON object <xref target="RFC8259"/> encoded in
   UTF-8. The media type used to serve the document <bcp14>SHOULD</bcp14> be
   "application/json".</t>
        <t>
   The top-level object <bcp14>MUST</bcp14> contain the following members:</t>
        <ul spacing="normal">
          <li>"version"</li>
          <li>"authority_information"</li>
          <li>"trust_anchors"</li>
        </ul>
        <t>
   The "version" member identifies the metadata format version and
   processing rules. This specification defines version 1.</t>
      </section>
      <section anchor="sect-5.2" numbered="true" toc="default">
        <name>Top-Level Members</name>
        <dl newline="true" spacing="normal" indent="3">
          <dt>version:</dt>
          <dd>
  <bcp14>REQUIRED</bcp14>. Integer. For this specification, the value <bcp14>MUST</bcp14> be 1.
  </dd>
          <dt>authority_information:</dt>
          <dd>
  <bcp14>REQUIRED</bcp14>. Object. Contains descriptive information about the
      publishing authority.
  </dd>
          <dt>trust_anchors:</dt>
          <dd>
  <bcp14>REQUIRED</bcp14>. Array of one or more trust anchor objects.
  </dd>
        </dl>
      </section>
      <section anchor="sect-5.3" numbered="true" toc="default">
        <name>authority_information Object</name>
        <t>
   The "authority_information" object contains the following members:</t>
        <dl newline="true" spacing="normal" indent="3">
          <dt>ca_name:</dt>
          <dd>
  <bcp14>REQUIRED</bcp14>. String. A human-readable name for the publishing CA
      or trust authority. The value <bcp14>MUST</bcp14> be between 1 and 200
      characters in length.
  </dd>
          <dt>contacts:</dt>
          <dd>
  <bcp14>OPTIONAL</bcp14>. Array of one or more contact strings. Each value
      <bcp14>SHOULD</bcp14> identify an operational or security contact, such as an
      email address. Duplicate values <bcp14>MUST NOT</bcp14> appear in the array.
  </dd>
        </dl>
      </section>
      <section anchor="sect-5.4" numbered="true" toc="default">
        <name>trust_anchor Object</name>
        <t>
   Each element of the "trust_anchors" array is an object containing
   the following members:</t>
        <dl newline="true" spacing="normal" indent="3">
          <dt>usage_context:</dt>
          <dd>
  <bcp14>REQUIRED</bcp14>. String. Identifies the application context for the
      published trust material. The value <bcp14>MUST</bcp14> match the token syntax
      defined in <xref target="sect-7"/>. Clients <bcp14>MUST</bcp14> ignore trust anchor objects
      whose "usage_context" value is not recognized.
  </dd>
          <dt>certificate_chains:</dt>
          <dd>
  <bcp14>REQUIRED</bcp14>. Array of one or more certificate chain objects as
      defined in <xref target="sect-5.5"/>.
  </dd>
          <dt>constraints:</dt>
          <dd>
  <bcp14>OPTIONAL</bcp14>. Object. Contains scoping constraints that limit the
      intended use of the published trust anchor. If present, the
      object <bcp14>MUST</bcp14> contain at least one member.
  </dd>
        </dl>
      </section>
      <section anchor="sect-5.5" numbered="true" toc="default">
        <name>certificate_chain Object</name>
        <t>
   Each "certificate_chain" object contains the following members:</t>
        <dl newline="true" spacing="normal" indent="3">
          <dt>valid_from:</dt>
          <dd>
  <bcp14>REQUIRED</bcp14>. String containing an <xref target="RFC3339"/> date-time value. The
      time from which this chain is intended to be used.
  </dd>
          <dt>valid_until:</dt>
          <dd>
  <bcp14>REQUIRED</bcp14>. String containing an <xref target="RFC3339"/> date-time value. The
      time after which this chain is no longer intended to be used.
      The value of "valid_from" <bcp14>MUST</bcp14> identify a point in time strictly
      earlier than the value of "valid_until".
  </dd>
          <dt>ca_chain_url:</dt>
          <dd>
  <bcp14>REQUIRED</bcp14>. Absolute HTTPS URI. Identifies a resource containing
      the certificate chain material. The URI <bcp14>MUST</bcp14> be same-origin with
      the metadata document URI.
  </dd>
          <dt>chain_format:</dt>
          <dd>
  <bcp14>REQUIRED</bcp14>. String. Identifies the encoding format of the
      certificate chain resource. For this specification, the value
      <bcp14>MUST</bcp14> be "pem_x509_chain".
  </dd>
          <dt>crl_url:</dt>
          <dd>
  <bcp14>OPTIONAL</bcp14>. Absolute URI for a Certificate Revocation List
      resource. Publishers <bcp14>SHOULD</bcp14> use an HTTPS URI.
  </dd>
          <dt>ocsp_responder_url:</dt>
          <dd>
  <bcp14>OPTIONAL</bcp14>. Absolute URI for an OCSP responder endpoint.
      Publishers <bcp14>SHOULD</bcp14> use an HTTPS URI.
  </dd>
          <dt>sha256_fingerprint:</dt>
          <dd>
  <bcp14>OPTIONAL</bcp14>. Hex-encoded SHA-256 fingerprint of the primary trust
      anchor certificate, encoded as a hexadecimal string of exactly
      64 characters.
  </dd>
        </dl>
        <t>
   At least one of "crl_url" or "ocsp_responder_url" <bcp14>SHOULD</bcp14> be present.
   A publisher <bcp14>MAY</bcp14> provide both.</t>
      </section>
      <section anchor="sect-5.6" numbered="true" toc="default">
        <name>constraints Object</name>
        <t>
   The "constraints" object, if present, <bcp14>MUST</bcp14> contain at least one
   member. This specification defines the following members:</t>
        <dl newline="true" spacing="normal" indent="3">
          <dt>permitted_domains:</dt>
          <dd>
  <bcp14>OPTIONAL</bcp14>. Array of one or more DNS host names. If present,
      these identify DNS domains for which the published trust anchor
      is intended to be used. Each value <bcp14>MUST</bcp14> be identical to, or a
      subdomain of, at least one DNS identifier present in the
      validated TLS certificate of the metadata document origin.
      Duplicate values <bcp14>MUST NOT</bcp14> appear in the array.
  </dd>
          <dt>isolated_store_required:</dt>
          <dd>
  <bcp14>OPTIONAL</bcp14>. Boolean. Indicates that the publisher expects the
      trust anchor to be used only in an application-isolated trust
      store and not to be installed into a global operating system
      trust store. This member expresses publisher intent. It does
      not create a technical enforcement mechanism on its own.
  </dd>
        </dl>
        <t>
   Future specifications may define additional constraint members.</t>
      </section>
      <section anchor="sect-5.7" numbered="true" toc="default">
        <name>Certificate Chain Resource</name>
        <t>
   A "ca_chain_url" resource with "chain_format" equal to
   "pem_x509_chain" <bcp14>MUST</bcp14> contain one or more PEM-encoded X.509
   certificates <xref target="RFC5280"/>.</t>
        <t>
   The certificates <bcp14>MUST</bcp14> be presented in certification path order,
   beginning with the most specific CA certificate intended for use by
   the client. The sequence <bcp14>MAY</bcp14> end with a self-signed root
   certificate.</t>
        <t>
   Consuming clients <bcp14>MUST</bcp14> be able to process a chain resource whether
   or not the final self-signed root certificate is included.</t>
      </section>
      <section anchor="sect-5.8" numbered="true" toc="default">
        <name>Example</name>
        <t>
   The following example illustrates a version 1 metadata document.
   Note that long URIs have been wrapped for readability only.</t>
        <sourcecode type="json"><![CDATA[
{
  "version": 1,
  "authority_information": {
    "ca_name": "Example Company Root CA",
    "contacts": ["security@example.org"]
  },
  "trust_anchors": [
    {
      "usage_context": "email_protection",
      "certificate_chains": [
        {
          "valid_from": "2026-01-01T00:00:00Z",
          "valid_until": "2031-01-01T00:00:00Z",
          "ca_chain_url": "https://example.org/.well-known/\
company-certs/certs/smime-chain-v2.pem",
          "chain_format": "pem_x509_chain",
          "crl_url": "https://example.org/.well-known/\
company-certs/certs/smime-v2.crl",
          "ocsp_responder_url": "https://example.org/ocsp/smime"
        },
        {
          "valid_from": "2021-01-01T00:00:00Z",
          "valid_until": "2026-06-01T00:00:00Z",
          "ca_chain_url": "https://example.org/.well-known/\
company-certs/certs/smime-chain-v1.pem",
          "chain_format": "pem_x509_chain",
          "crl_url": "https://example.org/.well-known/\
company-certs/certs/smime-v1.crl"
        }
      ],
      "constraints": {
        "permitted_domains": ["example.org", "sub.example.org"],
        "isolated_store_required": true
      }
    }
  ]
}
]]></sourcecode>
      </section>
    </section>
    <section anchor="sect-6" numbered="true" toc="default">
      <name>Client Processing Rules</name>
      <section anchor="sect-6.1" numbered="true" toc="default">
        <name>HTTPS Validation</name>
        <t>
   A consuming client <bcp14>MUST</bcp14> retrieve the metadata document over HTTPS
   and <bcp14>MUST</bcp14> perform normal HTTPS server authentication and certificate
   validation for the origin from which the metadata document is
   retrieved.</t>
        <t>
   If HTTPS validation fails, the metadata document <bcp14>MUST</bcp14> be rejected.</t>
      </section>
      <section anchor="sect-6.2" numbered="true" toc="default">
        <name>Scope of Publisher Authority</name>
        <t>
   This specification derives publisher authority from successful
   validation of the HTTPS endpoint for the metadata document origin.</t>
        <t>
   If the "constraints.permitted_domains" member is present, each
   listed domain <bcp14>MUST</bcp14> be either identical to, or a subdomain of, at
   least one DNS identifier present in the validated TLS certificate
   for the metadata document origin.</t>
        <t>
   If this condition is not met, the client <bcp14>MUST</bcp14> reject the affected
   trust anchor object.</t>
        <t>
   This rule intentionally limits the scope that a publisher can assert
   through the metadata document based on demonstrated control of the
   endpoint's DNS namespace.</t>
      </section>
      <section anchor="sect-6.3" numbered="true" toc="default">
        <name>Retrieval of Certificate Chain Resources</name>
        <t>
   The value of "ca_chain_url" <bcp14>MUST</bcp14> be an absolute HTTPS URI.</t>
        <t>
   To reduce cross-origin trust ambiguity, "ca_chain_url" <bcp14>MUST</bcp14> be
   same-origin with the metadata document URI; that is, it <bcp14>MUST</bcp14> use
   the same scheme, host, and port as the metadata document.</t>
        <t>
   If a "ca_chain_url" does not satisfy this requirement, the client
   <bcp14>MUST</bcp14> reject that certificate chain object.</t>
      </section>
      <section anchor="sect-6.4" numbered="true" toc="default">
        <name>Use of Revocation Information</name>
        <t>
   If present, "crl_url" and "ocsp_responder_url" provide revocation
   information associated with the published chain <xref target="RFC6960"/>.</t>
        <t>
   Publishers <bcp14>SHOULD</bcp14> use HTTPS for revocation resources when supported
   by their deployment environment. Clients <bcp14>MAY</bcp14> apply stricter local
   policy and refuse retrieval of revocation information over insecure
   transport.</t>
        <t>
   This document does not override revocation information embedded in
   certificates themselves. A client <bcp14>MAY</bcp14> use the metadata-provided
   revocation endpoints, the certificate-embedded endpoints, or both,
   according to local policy.</t>
      </section>
      <section anchor="sect-6.5" numbered="true" toc="default">
        <name>Selection Among Multiple Chains</name>
        <t>
   A client <bcp14>MAY</bcp14> encounter multiple "certificate_chain" entries for the
   same "usage_context".</t>
        <t>
   The client <bcp14>MUST</bcp14> ignore any chain whose current time is outside the
   inclusive interval defined by "valid_from" and "valid_until".</t>
        <t>
   If multiple chains remain applicable, the client <bcp14>SHOULD</bcp14> prefer the
   applicable chain with the most recent "valid_from" value, unless
   overridden by local policy.</t>
      </section>
      <section anchor="sect-6.6" numbered="true" toc="default">
        <name>Unknown or Unsupported Values</name>
        <t>
   If a client encounters a "usage_context" value that it does not
   support, it <bcp14>MUST</bcp14> ignore the corresponding trust anchor object.</t>
        <t>
   If the metadata "version" value is not understood by the client,
   the client <bcp14>MUST</bcp14> reject the metadata document.</t>
      </section>
    </section>
    <section anchor="sect-7" numbered="true" toc="default">
      <name>Initial Usage Context Values</name>
      <t>
   This specification defines the following initial "usage_context"
   values. Each value <bcp14>MUST</bcp14> match the token syntax pattern:</t>
      <sourcecode><![CDATA[
^[a-z][a-z0-9_-]{0,63}$
]]></sourcecode>
      <dl newline="true" spacing="normal" indent="3">
        <dt>email_protection:</dt>
        <dd>
  Trust anchor intended for S/MIME or comparable email protection
      use cases.
  </dd>
        <dt>client_authentication:</dt>
        <dd>
  Trust anchor intended for validating client certificates, such
      as mutual TLS client authentication.
  </dd>
        <dt>server_authentication:</dt>
        <dd>
  Trust anchor intended for validating server certificates in a
      scoped application-specific context.
  </dd>
      </dl>
      <t>
   Additional values may be registered in the IANA registry defined
   in <xref target="sect-10.2"/>.</t>
    </section>
    <section anchor="sect-8" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
   The security of this mechanism depends primarily on correct HTTPS
   validation for the metadata document endpoint and on the consuming
   application's correct enforcement of scope and isolation rules.</t>
      <t>
   Control over the publishing DNS domain is sufficient to publish
   trust anchor metadata for that domain under this specification.
   Therefore, compromise of the domain, DNS resolution path, hosting
   environment, content delivery path, or HTTPS private key may allow
   an attacker to publish malicious trust anchors.</t>
      <t>
   This specification does not provide an independent trust assessment
   of the published CA hierarchy beyond demonstrated control of the
   publishing domain.</t>
      <t>
   Clients <bcp14>MUST</bcp14> treat discovered trust anchors as application-scoped
   trust material and <bcp14>MUST NOT</bcp14> automatically install them into a global
   system trust store solely on the basis of this metadata document.</t>
      <t>
   If "isolated_store_required" is present and set to true, clients
   that cannot honor such isolation <bcp14>SHOULD</bcp14> reject the corresponding
   trust anchor object.</t>
      <t>
   Implementations <bcp14>SHOULD</bcp14> protect against replay and stale metadata.
   Clients <bcp14>SHOULD</bcp14> apply ordinary HTTP caching controls conservatively
   and <bcp14>SHOULD</bcp14> revalidate metadata periodically. Clients <bcp14>MAY</bcp14> impose
   maximum metadata freshness intervals by local policy.</t>
      <t>
   Publishers <bcp14>SHOULD</bcp14> avoid weak signature algorithms and weak key sizes
   in published trust anchor material. Clients <bcp14>MAY</bcp14> reject certificates
   or chains that do not satisfy local cryptographic policy.</t>
      <t>
   The first successful retrieval of metadata remains a trust bootstrap
   event. Implementers should recognize that this event is sensitive
   to endpoint compromise and other active attacks against the
   publishing origin.</t>
    </section>
    <section anchor="sect-9" numbered="true" toc="default">
      <name>Privacy Considerations</name>
      <t>
   Retrieval of the metadata document may reveal that a client is
   interested in a particular organization's trust infrastructure or
   application relationship.</t>
      <t>
   Retrieval of usage-specific chain or revocation resources may
   further reveal intended application behavior, such as email
   protection or client authentication.</t>
      <t>
   Publishers and consumers <bcp14>SHOULD</bcp14> minimize unnecessary identifying
   information in requests and responses. Consumers <bcp14>SHOULD</bcp14> avoid
   excessive polling and <bcp14>SHOULD</bcp14> apply data minimization principles
   where possible.</t>
    </section>
    <section anchor="sect-10" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <section anchor="sect-10.1" numbered="true" toc="default">
        <name>Well-Known URI Registration</name>
        <t>
   IANA is requested to register the "company-certs" well-known URI in
   the "Well-Known URIs" registry in accordance with RFC 8615 <xref target="RFC8615"/>.</t>
        <dl newline="false" spacing="normal" indent="3">
          <dt>URI suffix:</dt>
          <dd>
            <t>
  company-certs
            </t>
          </dd>
          <dt>Change controller:</dt>
          <dd>
            <t>
  IETF
            </t>
          </dd>
          <dt>Specification document:</dt>
          <dd>
            <t>
  [this document]
            </t>
          </dd>
        </dl>
      </section>
      <section anchor="sect-10.2" numbered="true" toc="default">
        <name>Company-Certs Usage Contexts Registry</name>
        <t>
   IANA is requested to create a new registry titled
   "Company-Certs Usage Contexts".</t>
        <dl newline="false" spacing="normal" indent="3">
          <dt>Registration policy:</dt>
          <dd>
            <t>
  Specification Required
            </t>
          </dd>
        </dl>
        <t>
   Initial registry contents:</t>
        <table align="center">
          <thead>
            <tr>
              <th align="left"> Value</th>
              <th align="left"> Description</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">email_protection</td>
              <td align="left">Application-specific email trust</td>
            </tr>
            <tr>
              <td align="left">client_authentication</td>
              <td align="left">Application-specific client cert trust</td>
            </tr>
            <tr>
              <td align="left">server_authentication</td>
              <td align="left">Application-specific server cert trust</td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
  </middle>
  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC3339" target="https://www.rfc-editor.org/info/rfc3339" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3339.xml">
        <front>
          <title>Date and Time on the Internet: Timestamps</title>
          <author fullname="G. Klyne" initials="G." surname="Klyne"/>
          <author fullname="C. Newman" initials="C." surname="Newman"/>
          <date month="July" year="2002"/>
        </front>
        <seriesInfo name="RFC" value="3339"/>
        <seriesInfo name="DOI" value="10.17487/RFC3339"/>
      </reference>
      <reference anchor="RFC5280" target="https://www.rfc-editor.org/info/rfc5280" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml">
        <front>
          <title>Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile</title>
          <author fullname="D. Cooper" initials="D." surname="Cooper"/>
          <author fullname="S. Santesson" initials="S." surname="Santesson"/>
          <author fullname="S. Farrell" initials="S." surname="Farrell"/>
          <author fullname="S. Boeyen" initials="S." surname="Boeyen"/>
          <author fullname="R. Housley" initials="R." surname="Housley"/>
          <author fullname="W. Polk" initials="W." surname="Polk"/>
          <date month="May" year="2008"/>
        </front>
        <seriesInfo name="RFC" value="5280"/>
        <seriesInfo name="DOI" value="10.17487/RFC5280"/>
      </reference>
      <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
      <reference anchor="RFC8259" target="https://www.rfc-editor.org/info/rfc8259" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8259.xml">
        <front>
          <title>The JavaScript Object Notation (JSON) Data Interchange Format</title>
          <author fullname="T. Bray" initials="T." role="editor" surname="Bray"/>
          <date month="December" year="2017"/>
        </front>
        <seriesInfo name="STD" value="90"/>
        <seriesInfo name="RFC" value="8259"/>
        <seriesInfo name="DOI" value="10.17487/RFC8259"/>
      </reference>
      <reference anchor="RFC8615" target="https://www.rfc-editor.org/info/rfc8615" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8615.xml">
        <front>
          <title>Well-Known Uniform Resource Identifiers (URIs)</title>
          <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
          <date month="May" year="2019"/>
        </front>
        <seriesInfo name="RFC" value="8615"/>
        <seriesInfo name="DOI" value="10.17487/RFC8615"/>
      </reference>
    </references>
    <references>
      <name>Informative References</name>
      <reference anchor="I-D.bhutton-json-schema" target="https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-01" xml:base="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.draft-bhutton-json-schema-01.xml">
        <front>
          <title>JSON Schema: A Media Type for Describing JSON Documents</title>
          <author fullname="Austin Wright" initials="A." surname="Wright"/>
          <author fullname="Henry Andrews" initials="H." surname="Andrews"/>
          <author fullname="Ben Hutton" initials="B." surname="Hutton">
            <organization>Postman</organization>
          </author>
          <author fullname="Greg Dennis" initials="G." surname="Dennis"/>
          <date day="10" month="June" year="2022"/>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-bhutton-json-schema-01"/>
      </reference>
      <reference anchor="RFC6960" target="https://www.rfc-editor.org/info/rfc6960" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6960.xml">
        <front>
          <title>X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP</title>
          <author fullname="S. Santesson" initials="S." surname="Santesson"/>
          <author fullname="M. Myers" initials="M." surname="Myers"/>
          <author fullname="R. Ankney" initials="R." surname="Ankney"/>
          <author fullname="A. Malpani" initials="A." surname="Malpani"/>
          <author fullname="S. Galperin" initials="S." surname="Galperin"/>
          <author fullname="C. Adams" initials="C." surname="Adams"/>
          <date month="June" year="2013"/>
        </front>
        <seriesInfo name="RFC" value="6960"/>
        <seriesInfo name="DOI" value="10.17487/RFC6960"/>
      </reference>
    </references>
    <section anchor="sect-a" numbered="true" toc="default">
      <name>JSON Schema for Version 1 Metadata Documents</name>
      <t>
   This appendix provides a normative JSON Schema <xref target="I-D.bhutton-json-schema"/> for
   version 1 metadata documents as defined in Section 5 of this
   specification.</t>
      <t>
   A metadata document that validates successfully against this schema
   satisfies the structural requirements of this specification.
   Successful schema validation does not, however, imply that all
   processing rules defined in <xref target="sect-6"/> are satisfied. The schema is
   expressed using JSON Schema Draft 2020-12 <xref target="I-D.bhutton-json-schema"/>.</t>
      <sourcecode type="schema"><![CDATA[
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:ietf:params:json-schema:company-certs-metadata",
  "title": "Company-Certs Metadata Schema",
  "type": "object",
  "required": [
    "version",
    "authority_information",
    "trust_anchors"
  ],
  "additionalProperties": false,
  "properties": {
    "version": {
      "type": "integer",
      "const": 1,
      "description":
        "Metadata format version. This specification defines"
        " version 1."
    },
    "authority_information": {
      "$ref": "#/$defs/authority_information"
    },
    "trust_anchors": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/trust_anchor"
      }
    }
  },
  "$defs": {
    "authority_information": {
      "type": "object",
      "required": [
        "ca_name"
      ],
      "additionalProperties": false,
      "properties": {
        "ca_name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description":
            "Human-readable name of the publishing CA or trust"
            " authority."
        },
        "contacts": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "format": "email"
          },
          "description":
            "Optional operational or security contacts. Each"
            " value SHOULD identify an email address."
        }
      }
    },
    "trust_anchor": {
      "type": "object",
      "required": [
        "usage_context",
        "certificate_chains"
      ],
      "additionalProperties": false,
      "properties": {
        "usage_context": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_\\-]{0,63}$",
          "description":
            "Application context token. Values are registered in"
            " the IANA Company-Certs Usage Contexts registry"
            " defined in Section 10.2. Unrecognized values MUST"
            " be ignored by the consuming client."
        },
        "certificate_chains": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/certificate_chain"
          }
        },
        "constraints": {
          "$ref": "#/$defs/constraints"
        }
      }
    },
    "certificate_chain": {
      "type": "object",
      "required": [
        "valid_from",
        "valid_until",
        "ca_chain_url",
        "chain_format"
      ],
      "additionalProperties": false,
      "properties": {
        "valid_from": {
          "type": "string",
          "format": "date-time",
          "description":
            "RFC 3339 date-time value indicating start of window"
            " for this chain. MUST be earlier than valid_until."
        },
        "valid_until": {
          "type": "string",
          "format": "date-time",
          "description":
            "RFC 3339 date-time value indicating end of intended"
            " window for this chain. MUST be later than valid_from."
        },
        "ca_chain_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://",
          "description":
            "Absolute HTTPS URI for certificate chain resource."
            " MUST be same-origin with metadata document URI."
        },
        "chain_format": {
          "type": "string",
          "enum": [
            "pem_x509_chain"
          ],
          "description":
            "Encoding format of certificate chain resource. Value"
            " 'pem_x509_chain' denotes PEM-encoded X.509 certs in"
            " path order, starting with specific CA cert."
        },
        "crl_url": {
          "type": "string",
          "format": "uri",
          "description":
            "Optional URI for CRL resource. Publishers SHOULD"
            " use HTTPS URI."
        },
        "ocsp_responder_url": {
          "type": "string",
          "format": "uri",
          "description":
            "Optional URI for OCSP responder endpoint. Publishers"
            " SHOULD use HTTPS URI."
        },
        "sha256_fingerprint": {
          "type": "string",
          "pattern": "^[A-Fa-f0-9]{64}$",
          "description":
            "Optional SHA-256 fingerprint of primary trust anchor"
            " certificate, encoded as hex string of 64 chars."
        }
      }
    },
    "constraints": {
      "type": "object",
      "minProperties": 1,
      "additionalProperties": false,
      "properties": {
        "permitted_domains": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "format": "hostname"
          },
          "description":
            "DNS domains for which trust anchor is intended to be"
            " used. Each value MUST be identical to or subdomain of"
            " origin TLS SANs."
        },
        "isolated_store_required": {
          "type": "boolean",
          "description":
            "Publisher intent that trust anchor be used only in"
            " application-isolated store and not installed into"
            " global OS trust store."
        }
      }
    }
  }
}
]]></sourcecode>
      <section anchor="sect-a.1" numbered="true" toc="default">
        <name>Schema Limitations</name>
        <t>
   The following requirements defined in this specification cannot be
   expressed within the JSON Schema above and <bcp14>MUST</bcp14> be enforced by
   consuming applications independently:</t>
        <dl newline="false" spacing="normal" indent="4">
          <dt>a)</dt>
          <dd>
            <t>
  Temporal ordering: "valid_from" <bcp14>MUST</bcp14> identify a point in time
  strictly earlier than "valid_until". A schema validator will
  accept any two syntactically valid date-time strings regardless
  of their relative order.
            </t>
          </dd>
          <dt>b)</dt>
          <dd>
            <t>
  Same-origin enforcement: "ca_chain_url" <bcp14>MUST</bcp14> be same-origin
  with the metadata document URI. JSON Schema cannot evaluate
  the retrieval context of a document.
            </t>
          </dd>
          <dt>c)</dt>
          <dd>
            <t>
  TLS SAN coverage: If "constraints.permitted_domains" is
  present, each listed domain <bcp14>MUST</bcp14> be identical to, or a
  subdomain of, at least one DNS identifier present in the
  validated TLS certificate of the metadata document origin.
  This requires access to the TLS session context, which is
  outside the scope of JSON Schema validation.
            </t>
          </dd>
          <dt>d)</dt>
          <dd>
            <t>
  Version rejection: If the "version" value is not understood,
  the metadata document <bcp14>MUST</bcp14> be rejected. A schema validator
  using "const": 1 will reject documents with other version
  values, but consuming applications <bcp14>MUST NOT</bcp14> rely solely on
  schema validation for this check.
            </t>
          </dd>
          <dt>e)</dt>
          <dd>
            <t>
  Chain selection: When multiple "certificate_chain" entries are
  present for the same "usage_context", the selection rules
  defined in <xref target="sect-6.5"/> <bcp14>MUST</bcp14> be applied by the consuming
  application.
            </t>
          </dd>
        </dl>
      </section>
    </section>
  </back>
</rfc>
