<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>


<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC4210 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4210.xml">
<!ENTITY RFC4270 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4270.xml">
<!ENTITY RFC8174 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC5272 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5272.xml">
<!ENTITY RFC5280 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml">
<!ENTITY RFC5912 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5912.xml">
]>

<?rfc toc="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>

<rfc submissionType="IETF" consensus="yes" ipr="trust200902" number="8649"  category="info">

  <front>
    <title abbrev="Hash Of Root Key Extension">Hash Of Root Key Certificate Extension</title>

    <author initials="R." surname="Housley" fullname="Russ Housley">
      <organization>Vigil Security</organization>
      <address>
        <postal>
          <street>516 Dranesville Road</street>
          <city>Herndon, VA</city>
          <code>20170</code>
          <country>United States of America</country>
        </postal>
        <email>housley@vigilsec.com</email>
      </address>
    </author>

    <date year="2019" month="August"/>

    <area>Security</area>
    

<keyword>trust anchor</keyword>


    <abstract>


<t>This document specifies the Hash Of Root Key certificate extension.  This
certificate extension is carried in the self-signed certificate for a trust
anchor, which is often called a Root Certification Authority (CA) certificate.
This certificate extension unambiguously identifies the next public key that
will be used at some point in the future as the next Root CA certificate,
eventually replacing the current one.</t>



    </abstract>


  </front>

  <middle>


<section anchor="intro" title="Introduction">


<t>This document specifies the Hash Of Root Key X.509 version 3 certificate
extension.  The extension is an optional addition to the Internet X.509 Public
Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile
<xref target="RFC5280"/>.  The certificate extension facilitates the orderly
transition from one Root Certification Authority (CA) public key to the next.
It does so by publishing the hash value of the next-generation public key in
the current self-signed certificate.  This hash value is a commitment to a
particular public key in the next-generation self-signed certificate.  This
commitment allows a relying party to unambiguously recognize the
next-generation self-signed certificate when it becomes available, install the
new self-signed certificate in the trust anchor store, and eventually remove
the previous one from the trust anchor store.</t>


<t>A Root CA certificate MAY include the Hash Of Root Key certificate extension
to provide the hash value of the next public key that will be used by the Root
CA.</t>

<section anchor="terms" title="Terminology">

        <t>
    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
    NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
    "MAY", and "OPTIONAL" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>

</section>
<section anchor="asn1" title="ASN.1">

<t>Certificates <xref target="RFC5280"/> use ASN.1 <xref target="X680"/>; Distinguished Encoding Rules (DER) <xref target="X690"/> are REQUIRED for certificate signing and validation.</t>

</section>
</section>
<section anchor="overview" title="Overview">

<t>Before the initial deployment of the Root CA, the following are generated:

<list>
   <t>R1 = The initial Root key pair<vspace />
   R2 = The second-generation Root key pair<vspace />
   H2 = Thumbprint (hash) of the public key of R2<vspace />
   C1 = Self-signed certificate for R1, which also contains H2</t>
</list>


</t>


<t>C1 is a self-signed certificate, and it contains H2 within the
HashOfRootKey extension.  C1 is distributed as part of the initial system
deployment. The HashOfRootKey certificate extension is described in <xref
target="extn"/>.</t>

<t>When the time comes to replace the initial Root CA certificate, R1, the following are generated:

<list>
   <t>R3 = The third-generation Root key pair <vspace />
   H3 = Thumbprint (hash) the public key of R3<vspace />
   C2 = Self-signed certificate for R2, which contains H3</t>
</list>
</t>

<t>This is an iterative process.  That is, R4 and H4 are generated when it is
time for C3 to replace C2, and so on.</t>

<t>The successor to the Root CA self-signed certificate can be delivered by
any means. Whenever a new Root CA self-signed certificate is received, the
recipient is able to verify that the potential Root CA certificate links back
to a previously authenticated Root CA certificate with the HashOfRootKey
certificate extension.  That is, the recipient verifies the signature on the
self-signed certificate and verifies that the hash of the DER-encoded
SubjectPublicKeyInfo from the potential Root CA certificate matches the value
from the HashOfRootKey certificate extension of the current Root CA
certificate.  Checking the self-signed certificate signature ensures that the
certificate contains the subject name, public key algorithm identifier, and
public key algorithm parameters intended by the key owner; these are important
inputs to certification path validation as defined in Section 6 of <xref
target="RFC5280"/>.  Checking the hash of the SubjectPublicKeyInfo ensures
that the certificate contains the intended public key.  If either check fails,
then the potential Root CA certificate is not a valid replacement, and the
recipient continues to use the current Root CA certificate.  If both checks
succeed, then the recipient adds the potential Root CA certificate to the
trust anchor store.  As discussed in <xref target="opcons"/>, the recipient
can remove the current Root CA certificate immediately in some situations.  In
other situations, the recipient waits an appropriate amount of time to ensure
that existing certification paths continue to validate.</t>

</section>
<section anchor="extn" title="Hash Of Root Key Certificate Extension">

<t>The HashOfRootKey certificate extension MUST NOT be critical.</t>

<t>The following ASN.1 <xref target="X680"/> <xref target="X690"/> syntax
defines the HashOfRootKey certificate extension:</t>

<figure><artwork><![CDATA[
ext-HashOfRootKey EXTENSION ::= {    -- Only in Root CA certificates
   SYNTAX         HashedRootKey
   IDENTIFIED BY  id-ce-hashOfRootKey
   CRITICALITY    {FALSE} }

HashedRootKey ::= SEQUENCE {
   hashAlg        HashAlgorithm,        -- Hash algorithm used
   hashValue      OCTET STRING }        -- Hash of DER-encoded
                                        --   SubjectPublicKeyInfo

id-ce-hashOfRootKey  ::=  OBJECT IDENTIFIER { 1 3 6 1 4 1 51483 2 1 }
]]></artwork></figure>

<t>The definitions of EXTENSION and HashAlgorithm can be found in <xref target="RFC5912"/>.</t>

<t>The hashAlg indicates the one-way hash algorithm that was used to compute the hash value.</t>

<t>The hashValue contains the hash value computed from the next-generation
public key.  The public key is the DER-encoded SubjectPublicKeyInfo as defined
in <xref target="RFC5280"/>.</t>

</section>
<section anchor="iana-considerations" title="IANA Considerations">

<t>This document has no IANA actions.
</t>

</section>
<section anchor="opcons" title="Operational Considerations">



<t>  Guidance on the transition from one root key to another is
available in Section 4.4 of <xref target="RFC4210"/>.  Of course, a root key
is also known as a trust anchor. In particular, the oldWithNew and
newWithOld advice ensures that relying parties are able to validate
certificates issued under the current Root CA certificate and the
next-generation Root CA certificate throughout the transition.  The notAfter
field in the oldWithNew certificate MUST cover the validity period of all
unexpired certificates issued under the old Root CA private key.  Further,
this advice SHOULD be followed by Root CAs to avoid the need for all relying
parties to make the transition at the same time.</t>

<t>After issuing the newWithOld certificate, the Root CA MUST stop using the
old private key to sign certificates.</t>

<t>Some enterprise and application-specific environments offer a directory
service or certificate repository to make certificate and CRLs available to
relying parties.  Section 3 in <xref target="RFC5280"/> describes a
certificate repository.  When a certificate repository is available, the
oldWithNew and newWithOld certificates SHOULD be published before the
successor to the current Root CA self-signed certificate is released.
Recipients that are able to obtain the oldWithNew certificate SHOULD
immediately remove the old Root CA self-signed certificate from the trust
anchor store.</t>

<t>In environments without such a directory service or repository, like the
Web PKI, recipients need a way to obtain the oldWithNew and newWithOld
certificates.  The Root CA SHOULD include the subject information access
extension <xref target="RFC5280"/> with the accessMethod set to
id-ad-caRepository and the assessLocation set to the HTTP URL that can be used
to fetch a DER-encoded "certs-only" (simple PKI response) message as specified
in <xref target="RFC5272"/> in all of their self-signed certificates.  The
Root CA SHOULD publish the "certs-only" message with the oldWithNew
certificate and the newWithOld certificate before the subsequent Root CA
self-signed certificate is released.  The "certs-only" message format allows
certificates to be added and removed from the bag of certificates over time,
so the same HTTP URL can be used throughout the lifetime of the Root CA.</t>

<t>In environments without such a directory service or repository, recipients
SHOULD keep both the old and replacement Root CA self-signed certificates in
the trust anchor store for some amount of time to ensure that all end-entity
certificates can be validated until they expire.  The recipient MAY keep the
old Root CA self-signed certificate until all of the certificates in the local
cache that are subordinate to it have expired.</t>

<t>Certification path construction is more complex when the trust anchor store
contains multiple self-signed certificates with the same distinguished name.
For this reason, the replacement Root CA self-signed certificate SHOULD
contain a different distinguished name than the one it is replacing.  One
approach is to include a number as part of the name that is incremented with
each generation, such as "Example CA", "Example CA G2", "Example CA G3", and
so on.</t>

<t>Changing names from one generation to another can lead to confusion when
reviewing the history of a trust anchor store.  To assist with such review, a
recipient MAY create an audit entry to capture the old and replacement
self-signed certificates.</t>

<t>The Root CA must securely back up the yet-to-be-deployed key pair.  If the
Root CA stores the key pair in a hardware security module and that module
fails, the Root CA remains committed to the key pair that is no longer
available.  This leaves the Root CA with no alternative but to deploy a new
self-signed certificate that contains a newly generated key pair in the same
manner as the initial self-signed certificate, thus losing the benefits of the
Hash Of Root Key certificate extension altogether.</t>

</section>
<section anchor="security-considerations" title="Security Considerations">

<t>The security considerations from <xref target="RFC5280"/> apply, especially
the discussion of self-issued certificates.</t>

<t>The Hash Of Root Key certificate extension facilitates the orderly
transition from one Root CA public key to the next by publishing the hash
value of the next-generation public key in the current certificate.  This
allows a relying party to unambiguously recognize the next-generation public
key when it becomes available; however, the full public key is not disclosed
until the Root CA releases the next-generation certificate.  In this way,
attackers cannot begin to analyze the public key before the next-generation
Root CA self-signed certificate is released.</t>

<t>The Root CA needs to ensure that the public key in the next-generation
certificate is as strong or stronger than the key that it is replacing.  Of
course, a significant advance in cryptoanalytic capability can break the
yet-to-be-deployed key pair.  Such advances are rare and difficult to predict.
If such an advance occurs, the Root CA remains committed to the now broken
key.  
This leaves the Root CA with no alternative but to deploy a new
self-signed certificate that contains a newly generated key pair, most likely
using a different signature algorithm, in the same manner as the initial
self-signed certificate, thus losing the benefits of the Hash Of Root Key
certificate extension altogether.</t>

<t>The Root CA needs to employ a hash function that is resistant to preimage
attacks <xref target="RFC4270"/>.  
A first-preimage attack against the hash
function would allow an attacker to find another input that results in the
hash value of the next-generation public key that was published
in the current certificate.
For the attack to be successful, the input would have to be a
valid SubjectPublicKeyInfo that contains a public key that corresponds to a
private key known to the attacker.  A second-preimage attack becomes possible
once the Root CA releases the next-generation public key, which makes the
input to the hash function available to the attacker and everyone else.
Again, the attacker needs to find a valid SubjectPublicKeyInfo that contains
the public key that corresponds to a private key known to the attacker.  If
the employed hash function is broken after the Root CA publishes the
self-signed certificate with the HashOfRootKey certificate extension, an
attacker would be able to trick the recipient into installing the incorrect
next-generation certificate in the trust anchor store.</t>

<t>If an early release of the next-generation public key occurs and the Root
CA is concerned that attackers were given too much lead time to analyze that
public key, then the Root CA can transition to a freshly generated key pair by
rapidly performing two transitions.  After the first transition, the Root CA
is using the key pair that suffered the early release, and that transition
causes the Root CA to generate the subsequent Root key pair.  The second
transition occurs when the Root CA is confident that the population of relying
parties has completed the first transition, and it takes the Root CA to the
freshly generated key pair.  Of course, the second transition also causes the
Root CA to generate another key pair that is reserved for future use.  Queries
for the CRLs associated with certificates that are subordinate to the
self-signed certificate can give some indication of the number of relying
parties that are still actively using the self-signed certificates.</t>

</section>


  </middle>

  <back>

    <references title='Normative References'>

&RFC2119;
&RFC4210;
&RFC4270;
&RFC8174;
&RFC5272;
&RFC5280;
&RFC5912;


<reference anchor="X680" >
  <front>
    <title>Information technology -- Abstract Syntax Notation One (ASN.1): Specification of basic notation</title>
    <author >
      <organization>ITU-T</organization>
    </author>
    <date month="August" year="2015"/>
  </front>
  <seriesInfo name="ITU-T" value="Recommendation X.680"/>
</reference>


<reference anchor="X690" >
  <front>
    <title>Information Technology -- ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)</title>
    <author >
      <organization>ITU-T</organization>
    </author>
    <date month="August" year="2015"/>
  </front>
  <seriesInfo name="ITU-T" value="Recommendation X.690"/>
</reference>

    </references>


    <references title='Informative References'>


<reference anchor="SET" >
  <front>
    <title>SET Secure Electronic Transaction Specification -- Book 2: Programmer's Guide, Version 1.0</title>
    <author >
      <organization>MasterCard and VISA</organization>
    </author>
    <date year="1997" month="May"/>
  </front>
</reference>


    </references>


<section anchor="asn1-module" title="ASN.1 Module">

<t>The following ASN.1 module provides the complete definition of the HashOfRootKey certificate extension.</t>


<figure><artwork><![CDATA[
<CODE BEGINS> 

HashedRootKeyCertExtn { 1 3 6 1 4 1 51483 0 1 }

DEFINITIONS IMPLICIT TAGS ::=
BEGIN

-- EXPORTS All

IMPORTS

HashAlgorithm
  FROM PKIX1-PSS-OAEP-Algorithms-2009  -- RFC 5912
       { iso(1) identified-organization(3) dod(6) internet(1)
         security(5) mechanisms(5) pkix(7) id-mod(0)
         id-mod-pkix1-rsa-pkalgs-02(54) }

EXTENSION
  FROM PKIX-CommonTypes-2009  -- RFC 5912
    { iso(1) identified-organization(3) dod(6) internet(1)
      security(5) mechanisms(5) pkix(7) id-mod(0)
      id-mod-pkixCommon-02(57) } ;

--
-- Expand the certificate extensions list in RFC 5912
--

CertExtensions EXTENSION ::= {
   ext-HashOfRootKey, ... }

--
-- HashOfRootKey Certificate Extension
--

ext-HashOfRootKey EXTENSION ::= {    -- Only in Root CA certificates
   SYNTAX         HashedRootKey
   IDENTIFIED BY  id-ce-hashOfRootKey
   CRITICALITY    {FALSE} }

HashedRootKey  ::=  SEQUENCE {
   hashAlg        HashAlgorithm,     -- Hash algorithm used
   hashValue      OCTET STRING }     -- Hash of DER-encoded
                                     --   SubjectPublicKeyInfo

id-ce-hashOfRootKey OBJECT IDENTIFIER  ::=  { 1 3 6 1 4 1 51483 2 1 }

END

<CODE ENDS>
]]></artwork></figure>

</section>

<section anchor="acknowledgements" title="Acknowledgements" numbered="no">

<t>The Secure Electronic Transaction (SET) <xref target="SET"/> specification
published by MasterCard and VISA in 1997 includes a very similar certificate
extension.  The SET certificate extension has essentially the same semantics,
but the syntax fairly different.</t>

<t>CTIA - The Wireless Association - is developing a public key infrastructure
that will make use of the certificate extension described in this document;
the object identifiers used in the ASN.1 module were assigned by CTIA.</t>

<t>Many thanks to Stefan Santesson, Jim Schaad, Daniel Kahn Gillmor, Joel
Halpern, Paul Hoffman, Rich Salz, and Ben Kaduk.  Their reviews and comments
greatly improved the document, especially the "Operational Considerations"
and "Security Considerations" sections.</t>

</section>

  </back>

</rfc>

